diff options
author | Dudemanguy <random342@airmail.cc> | 2023-09-27 21:52:44 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-09-27 22:38:13 -0500 |
commit | f40bbfec4fcd2d9a787a4d98ec7698a646e5607e (patch) | |
tree | 5fcf3c8c80548e578d6cc6f730c5cc5f33ea6e85 /player/audio.c | |
parent | 09b04fbf0940151f5856aa4396f9b467622371a3 (diff) | |
download | mpv-f40bbfec4fcd2d9a787a4d98ec7698a646e5607e.tar.bz2 mpv-f40bbfec4fcd2d9a787a4d98ec7698a646e5607e.tar.xz |
demux: improve stream selection state
This replaces the previous commit and makes more sense. The internal
demux marked tracks as eager depending on their type and for subtitles
it would always lazily read them unless there happened to be no
available av stream. However, we want the sub stream to be eager if the
player is paused. The existing subtitle is still preserved on the
screen, but if the user changes tracks that's when the problem occurs.
So to handle this case, propagate the mpctx->paused down to the stream
selection logic. This modifies both demuxer_refresh_track and
demuxer_select_track to take that boolean value. A few other parts of
the player use this, but we can just assume false there (no change in
behavior from before) since they should never be related to subtitles.
The core player code is aware of its own state naturally, and can always
pass the appropriate value so go ahead and do so. When we change the
pause state, a refresh seek is done on all existing subtitle tracks to
make sure their eager state is the appropriate value (i.e. so it's not
still set to eager after a pause and a track switch). Slightly invasive
change, but it works with the existing logic instead of going around it
so ultimately it should be a better approach. We can additionally remove
the old force boolean from sub_read_packets since it is no longer
needed.
Diffstat (limited to 'player/audio.c')
0 files changed, 0 insertions, 0 deletions