summaryrefslogtreecommitdiffstats
path: root/demux/demux.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-07-11 19:22:24 +0200
committerwm4 <wm4@nowhere>2013-07-11 19:22:24 +0200
commite5544e2da38522674edb1eb5d4cfdf179c4328db (patch)
tree3868c73a022520365a9bd9ef45810d7685b8e5a4 /demux/demux.h
parent83eb28fff7d3a588610c617d255ae2420b792c44 (diff)
downloadmpv-e5544e2da38522674edb1eb5d4cfdf179c4328db.tar.bz2
mpv-e5544e2da38522674edb1eb5d4cfdf179c4328db.tar.xz
demux: improve DVD sub auto-selection hack
The code touched by this commit makes sure that DVD subtitle tracks known by libdvdread but not known by demux_lavf can be selected and displayed properly. These subtitle tracks have the first packet some time late in the packet stream, so that libavformat won't immediately recognize them, and will add the track as soon as the first packet is seen during normal demuxing. demux_mpg used to handle this elegantly: you just set the MPEG ID of the stream you wanted. demux_lavf couldn't do this, so it was emulated with a DEMUXER_CTRL. This commit changes it so that new streams are selected by default (if autoselect is enabled), and the playloop simply can take appropriate action before the lower layer throws away the first packet. This also changes the demux_lavf behavior that subtitle packets are always demuxed, even if not needed. (They were immediately thrown away, so there was no advantage to this.) Further, this adds the ability to demux.c to deal with demuxing more than one stream of a kind at once. (Though currently it's not useful.)
Diffstat (limited to 'demux/demux.h')
-rw-r--r--demux/demux.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/demux/demux.h b/demux/demux.h
index 2b3a998289..d75c8f0d12 100644
--- a/demux/demux.h
+++ b/demux/demux.h
@@ -77,7 +77,6 @@ enum timestamp_type {
#define DEMUXER_CTRL_SWITCH_VIDEO 14
#define DEMUXER_CTRL_IDENTIFY_PROGRAM 15
#define DEMUXER_CTRL_CORRECT_PTS 16
-#define DEMUXER_CTRL_AUTOSELECT_SUBTITLE 17
#define SEEK_ABSOLUTE (1 << 0)
#define SEEK_FACTOR (1 << 1)
@@ -185,6 +184,7 @@ typedef struct demuxer {
struct sh_stream **streams;
int num_streams;
+ bool stream_autoselect;
int num_editions;
int edition;
@@ -255,6 +255,9 @@ int demux_control(struct demuxer *demuxer, int cmd, void *arg);
void demuxer_switch_track(struct demuxer *demuxer, enum stream_type type,
struct sh_stream *stream);
+void demuxer_select_track(struct demuxer *demuxer, struct sh_stream *stream,
+ bool selected);
+void demuxer_enable_autoselect(struct demuxer *demuxer);
int demuxer_type_by_filename(char *filename);