mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-29 15:11:09 +08:00
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.)
This commit is contained in:
+2
-3
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user