mirror of https://github.com/mpv-player/mpv
demux: don't allow subtitles to mess up buffered time display
In a shit show of subtle corner case interactions, making the demuxer cache buffer the entire file can display a small buffered time if subtitles are enabled. The reason is that some subtitle decoders may read in advance infinitely, i.e. they read the entire subtitle stream. Then, since the other streams (audio/video) have logically reached EOF, and the subtitle stream is set to ds->active==true. This will have to be fixed properly later to account buffering for subtitle-only files (another corner case) correctly, but for now this is less annoying.
This commit is contained in:
parent
36630585f6
commit
4fca1856e1
|
@ -2014,7 +2014,8 @@ static int cached_demux_control(struct demux_internal *in, int cmd, void *arg)
|
|||
double ts_max = MP_NOPTS_VALUE;
|
||||
for (int n = 0; n < in->num_streams; n++) {
|
||||
struct demux_stream *ds = in->streams[n]->ds;
|
||||
if (ds->active && !(!ds->queue_head && ds->eof) && !ds->ignore_eof)
|
||||
if (ds->active && !(!ds->queue_head && ds->eof) &&
|
||||
!ds->ignore_eof && ds->type != STREAM_SUB)
|
||||
{
|
||||
r->underrun |= !ds->reader_head && !ds->eof;
|
||||
r->ts_reader = MP_PTS_MAX(r->ts_reader, ds->base_ts);
|
||||
|
|
Loading…
Reference in New Issue