diff options
author | Guido Cella <guido@guidocella.xyz> | 2021-08-13 01:51:13 +0200 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2021-08-13 17:16:43 +0000 |
commit | d8e5f6ff3aae31fc03c43b98bbf0e272c741eb1d (patch) | |
tree | 19f508d8e8b9b2124055af4b65dbd6b96cc66630 /player | |
parent | 312e29cf7fff0f3d8d5a592b2fc2904063d7ded5 (diff) | |
download | mpv-d8e5f6ff3aae31fc03c43b98bbf0e272c741eb1d.tar.bz2 mpv-d8e5f6ff3aae31fc03c43b98bbf0e272c741eb1d.tar.xz |
sub: show subs without duration on vid change
When changing video track with subtitles with unknown duration, they
aren't shown until you seek, cycle sub back and forth, or apply a video
filter. This is caused by reinit_video_chain_src() calling
reset_subtitle_state() -> sub/sd_ass.c:reset() -> ass_flush_events()
when ctx->duration_unknown is true.
The ass_flush_events() call was added in a714f8e so subs with unknown
duration wouldn't multiply on seek, i.e. when reset_subtitle_state() is
called from reset_playback_state(). So keep calling it from there, and
in reinit_video_chain_src() use just term_osd_set_subs(mpctx, NULL)
instead to clear any subtitles printed to the terminal. The
reset_subtitle_state() call was added in c1ac97b to "reset the state
correctly when switching between video/no-video", but with it removed I
no longer notice any issue doing that.
Diffstat (limited to 'player')
-rw-r--r-- | player/video.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/player/video.c b/player/video.c index c13bdb4074..734835d850 100644 --- a/player/video.c +++ b/player/video.c @@ -288,7 +288,7 @@ void reinit_video_chain_src(struct MPContext *mpctx, struct track *track) } reset_video_state(mpctx); - reset_subtitle_state(mpctx); + term_osd_set_subs(mpctx, NULL); return; |