Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache flushing when enabling or changing to another subtitle or audio track causing buffering and dropped frames #8422

Closed
oddbondboris opened this issue Dec 26, 2020 · 4 comments
Labels

Comments

@oddbondboris
Copy link

oddbondboris commented Dec 26, 2020

Important Information

version: any version 20171225 to 20201206 (current release)
windows 7 64 bit
source of the binaries: https://sourceforge.net/projects/mpv-player-windows/files/ for the broken releases
I have no idea where I originally got the working version but it still can be found as mpv-x86_64-20170913.7z on various archives
issue introduced in 20171225

Reproduction steps

open any file (i've only tested with mkv and avi but it should happen on any format)
hit 3 or j to switch tracks from track to track or from disabled to a track
it will not happen when switching from a track to "no" aka when disabling subtitles
video should drop frames or audio might glitch as the cache underruns
displayed cache amount will reset to zero and count up

Expected behavior

In 20170913 switching tracks or enabling disabled tracks does not reset the cache amount and causes zero playback interruption

Actual behavior

Switching between audio tracks or subtitle tracks causes the demuxer to drop it's cache.

Log file

Log of opening a file, and pressing j, this file defaults to subtitles on so you have to hit j twice (once to turn the subs off and then once to turn them on again) but it works on any file i have found
20201206-broken.txt

This is the expected behavior: pressing j results in no cache amount decreases and no dropping
20170913-works.txt
possible source of the issue here: 719a435
a lot changed in this update with regard to caching.

@cwrau
Copy link

cwrau commented Feb 5, 2021

Happens to me too, the back-cache completely clears when switching subtitles.

My OS is arch linux

@varenc
Copy link
Contributor

varenc commented Mar 5, 2021

Same. Been this way for as long as I can remember though.

I think what's happening is that MPV discards irrelevant tracks so that they don't bloat the cache. When you change the a track, MPV then has to re-fetch everything to get the correct track and there's no way to just fetch a subtitle track out of a stream without also re-downloading everything else.

@cwrau
Copy link

cwrau commented Mar 5, 2021

Re-fetching everything makes sense for the other subtitle track, but discarding the other tracks is detrimental, especially when it's a network stream.

I often quickly toggle the subtitles on when I couldn't understand something and then turn them back off again, this prompts MPV to reload everything after now multiple times, sometimes 10x per file.

This may not be that big of a nuisance with files on disk, but with a network stream this could even be a problem.

This also happens with files on disk, just FYI

@Akemi
Copy link
Member

Akemi commented May 7, 2021

duplicate of #7780

@Akemi Akemi closed this as completed May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants