From 962a97a2dbf6997a7d1f92e63a7d5c1e25870464 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 12 Dec 2012 22:56:41 +0100 Subject: sd_lavc: keep subs on subtitle track switching Keep the currently displayed subtitles even when the user cycles through subtitle tracks, and the subtitle is decoded by libavcodec (such as vobsubs). Do this by not clearing the subtitles on reset(). reset() is also called on seek, so check the start PTS whether the subtitle should really be displayed (there's already an end PTS). Note that sd_ass does essentially something similar. The existing code has checks for whether the PTS reported by the demuxer is invalid (MP_NOPTS_VALUE). I don't know under what circumstances this can happens, so fall back to the old behavior if the PTS is invalid. --- core/mplayer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core') diff --git a/core/mplayer.c b/core/mplayer.c index 3e58279b51..e18acf9eac 100644 --- a/core/mplayer.c +++ b/core/mplayer.c @@ -1839,7 +1839,7 @@ static void update_subtitles(struct MPContext *mpctx, double refpts_tl) while (d_sub->first) { double subpts_s = ds_get_next_pts(d_sub); if (subpts_s > curpts_s) { - mp_dbg(MSGT_CPLAYER, MSGL_V, + mp_dbg(MSGT_CPLAYER, MSGL_DBG2, "Sub early: c_pts=%5.3f s_pts=%5.3f\n", curpts_s, subpts_s); // Libass handled subs can be fed to it in advance -- cgit v1.2.3