From 466fc6d4d18ac1751527ccfff8f3c39eb3ff1e4b Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 2 Oct 2012 23:28:18 +0200 Subject: sub: make it easier to set DVD sub decoding with sd_lavc With this commit, the player will still use spudec.c (the "old" DVD sub decoder), rather than ffmpeg. But it brings the changes needed to enable this down to a single line change: --- a/mplayer.c +++ b/mplayer.c @@ -1988,7 +1988,7 @@ static void reinit_subs(struct MPContext *mpctx) #endif vo_osd_changed(OSDTYPE_SUBTITLE); } else if (track->stream) { - if (mpctx->sh_sub->type == 'v') + if (mpctx->sh_sub->type == 'v' && false) init_vo_spudec(mpctx); else sub_init(mpctx->sh_sub, mpctx->osd); Also, copy the DVD resolution heuristics from spudec.c (from the spudec_new_scaled() function). I'm not sure if this is correct or even needed, but the sd_lavc codd explicitly reverted back to spudec with code carrying this comment: // Assume resolution heuristics only work for PGS and DVB so it seems likely that the required heuristics were missing, and that the spudec heuristics may make the DVD compatibility situation at least as good as with spudec. Note that it's unlikely that we enable sd_lavc for DVD subs by default, as there are other problems in combination with direct DVD playback. --- mplayer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mplayer.c') diff --git a/mplayer.c b/mplayer.c index 6fe8c649c4..a885fac8ca 100644 --- a/mplayer.c +++ b/mplayer.c @@ -1795,7 +1795,9 @@ static void update_subtitles(struct MPContext *mpctx, double refpts_tl) } // DVD sub: - if (track->vobsub_id_plus_one || type == 'v') { + if ((track->vobsub_id_plus_one || type == 'v') + && !(sh_sub && sh_sub->active)) + { int timestamp; // Get a sub packet from the demuxer (or the vobsub.c thing, which // should be a demuxer, but isn't). -- cgit v1.2.3