From 64b0395e21ccc3c79f95e37792f66f19245046e7 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 24 Jan 2013 12:25:58 +0100 Subject: sub: add stupid hack for vobsub decoding with Libav If we detect Libav, always use the old builtin vobsub decoder (in spudec.c). Note that we do not want to use it for newer ffmpeg, as spudec.c can't handle the vobsub packets as generated by the .idx demuxer, and we want to get rid of spudec.c in general anyway. --- core/mplayer.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/mplayer.c b/core/mplayer.c index 3528c46175..bdebd3bab2 100644 --- a/core/mplayer.c +++ b/core/mplayer.c @@ -29,6 +29,8 @@ #include #include +#include + #include "config.h" #include "talloc.h" @@ -2014,8 +2016,15 @@ static void reinit_subs(struct MPContext *mpctx) struct stream *s = track->demuxer ? track->demuxer->stream : NULL; if (s && s->type == STREAMTYPE_DVD) set_dvdsub_fake_extradata(mpctx->sh_sub, s, mpctx->sh_video); + // lavc dvdsubdec doesn't read color/resolution on Libav 9.1 and below + // Don't use it for new ffmpeg; spudec can't handle ffmpeg .idx demuxing + // (ffmpeg added .idx demuxing during lavc 54.79.100) + bool broken_lavc = false; +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54, 40, 0) + broken_lavc = true; +#endif if (mpctx->sh_sub->type == 'v' && track->demuxer - && track->demuxer->type == DEMUXER_TYPE_MPEG_PS) + && (track->demuxer->type == DEMUXER_TYPE_MPEG_PS || broken_lavc)) init_vo_spudec(mpctx); else sub_init(mpctx->sh_sub, mpctx->osd); -- cgit v1.2.3