diff options
author | wm4 <wm4@nowhere> | 2017-12-10 04:43:25 +0100 |
---|---|---|
committer | avih <avih@users.noreply.github.com> | 2017-12-10 06:37:49 +0200 |
commit | 451a502c1d15ad2c1b60a141c969be06fa10d152 (patch) | |
tree | 60f75d00e3a6929056ae6fef3efd91ebb21c8255 /audio/decode/ad_spdif.c | |
parent | 39bc954488c27e0de6168f827be2e9c68bbf1043 (diff) | |
download | mpv-451a502c1d15ad2c1b60a141c969be06fa10d152.tar.bz2 mpv-451a502c1d15ad2c1b60a141c969be06fa10d152.tar.xz |
demux: fix accounting for seekable ranges on track switches
This fixes missing audio when cycling through audio tracks with anything
that uses nested demuxers, such as demux_timeline, which us used for
EDL, --merge-files, ordered chapters, and youtube-dl pseudo DASH
support. When this bug happened, reenabling an audio track would lead to
silence for the duration of the readahead amount.
The underlying reason is the incorrectly updated buffered range on track
switch. It accidentally included the amount covered by the deselected
stream. But the cause of the observed effect was that demux_timeline
issued a refresh seek to the underlying slave demuxer, which in turn
thought it could do a cache seek, because the seek range still included
everything.
update_stream_selection_state() calls update_seek_ranges() to update the
seek ranges after a track switch. When reenabling the track, ds->eager
was set to false during update_seek_ranges(), which made it think the
stream was sparse, and thus it didn't restrict the current seek range
(making later code think everything was buffered). Fix this by moving
some code, so we first update the ds->eager flag, then the seek ranges.
Also verbose log the low level stream selection calls.
Diffstat (limited to 'audio/decode/ad_spdif.c')
0 files changed, 0 insertions, 0 deletions