diff options
author | wm4 <wm4@nowhere> | 2012-08-19 18:01:30 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-09-18 21:04:45 +0200 |
commit | 0f155921b046c9e6cfed3fe601aa891c2d2a8b16 (patch) | |
tree | ced8b2b76d00f3461bf12d0b5063ce2cf6fb8fe8 /libmpdemux/stheader.h | |
parent | 13482fb397ce6bbcec8a9342015f21d48fb7efe6 (diff) | |
download | mpv-0f155921b046c9e6cfed3fe601aa891c2d2a8b16.tar.bz2 mpv-0f155921b046c9e6cfed3fe601aa891c2d2a8b16.tar.xz |
core: manage tracks in the frontend
Introduce a general track struct for every audio/video/subtitle track
known to the frontend. External files (subtitles) are now represented
as tracks too. This mainly serves to clean up the subtitle selection
code: now every subtitle is simply a track, instead of using a messy
numbering that goes by subtitle type (as it was stored in the
global_sub_pos field). The mplayer fontend will list external subtitle
files as additional tracks.
The timeline code now tries to match the exact demuxer IDs of all
tracks. This may cause problems when Matroska files with different
track numberings are used with EDL timelines. Change demux_lavf not
to set demuxer IDs, since most time they are not set.
Diffstat (limited to 'libmpdemux/stheader.h')
-rw-r--r-- | libmpdemux/stheader.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libmpdemux/stheader.h b/libmpdemux/stheader.h index f36ac8c347..90d06f96d5 100644 --- a/libmpdemux/stheader.h +++ b/libmpdemux/stheader.h @@ -27,22 +27,24 @@ struct MPOpts; struct demuxer; enum stream_type { - STREAM_VIDEO = 1, + STREAM_VIDEO, STREAM_AUDIO, STREAM_SUB, + STREAM_TYPE_COUNT, }; // Stream headers: struct sh_stream { enum stream_type type; + struct demuxer *demuxer; // Index into demuxer->streams. int index; // The (possibly) type specific id, e.g. aid or sid. int tid; // Index into stream array (currently one array per type, e.g. a_streams). int stream_index; - // Demuxer specific ID (-1 if unknown, otherwise >= 0). + // Demuxer specific ID (always set, defaults to tid). int demuxer_id; // Abomination. struct sh_common *common_header; @@ -61,7 +63,6 @@ struct sh_stream { #define SH_COMMON \ - int id; \ struct sh_stream *gsh; \ const char *demuxer_codecname; \ struct MPOpts *opts; \ |