From 11383696dbfdcd54c3d4637ee027e0fddd420f87 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 11 Jul 2013 19:16:37 +0200 Subject: 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.) --- demux/demux_lavf.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'demux/demux_lavf.c') 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; } -- cgit v1.2.3