mirror of https://github.com/mpv-player/mpv
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 ina714f8e
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 inc1ac97b
to "reset the state correctly when switching between video/no-video", but with it removed I no longer notice any issue doing that.
This commit is contained in:
parent
312e29cf7f
commit
d8e5f6ff3a
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue