diff options
author | wm4 <wm4@nowhere> | 2013-07-11 19:16:37 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-07-11 19:16:37 +0200 |
commit | 11383696dbfdcd54c3d4637ee027e0fddd420f87 (patch) | |
tree | ad472b52ba9adec1f04b20034a6f12b4f9d57344 /demux | |
parent | 29cc249173687b72bebe75b0244f17ed33265f06 (diff) | |
download | mpv-11383696dbfdcd54c3d4637ee027e0fddd420f87.tar.bz2 mpv-11383696dbfdcd54c3d4637ee027e0fddd420f87.tar.xz |
demux_lavf: different hack for DVD sub autoselection hack
For now, we want to get rid of the demux->sub access, because this
field will become private to demux.c in a later commit. So replace the
current hack with another hack.
The need for the hack will be removed sooner or later. (Instead of
autoselecting a specific stream, all new streams will be enabled by
default, so that no packets can get lost. The frontend will then be
responsible to deselect unwanted streams.)
Diffstat (limited to 'demux')
-rw-r--r-- | demux/demux_lavf.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index aad1edfcde..ea8a82c403 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -658,11 +658,11 @@ static int demux_lavf_fill_buffer(demuxer_t *demux, demux_stream_t *dsds) AVStream *st = priv->avfc->streams[pkt->stream_index]; struct sh_stream *stream = priv->streams[pkt->stream_index]; - if (stream && stream->type == STREAM_SUB && !demux->sub->gsh && + if (stream && stream->type == STREAM_SUB && stream->demuxer_id == priv->autoselect_sub) { priv->autoselect_sub = -1; - demux->sub->gsh = stream; + demuxer_switch_track(demux, STREAM_SUB, stream); } if (!demuxer_stream_is_selected(demux, stream)) { @@ -809,7 +809,6 @@ static int demux_lavf_control(demuxer_t *demuxer, int cmd, void *arg) } case DEMUXER_CTRL_AUTOSELECT_SUBTITLE: { - demuxer->sub->gsh = NULL; priv->autoselect_sub = *((int *)arg); return DEMUXER_CTRL_OK; } |