diff options
author | wm4 <wm4@nowhere> | 2013-01-24 12:25:58 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-01-24 12:41:44 +0100 |
commit | 64b0395e21ccc3c79f95e37792f66f19245046e7 (patch) | |
tree | a70b27948e4aa10751200f0c5ceffc0a69a72455 /core | |
parent | 458c41c5c7236fe872094a542d191572584dfe61 (diff) | |
download | mpv-64b0395e21ccc3c79f95e37792f66f19245046e7.tar.bz2 mpv-64b0395e21ccc3c79f95e37792f66f19245046e7.tar.xz |
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.
Diffstat (limited to 'core')
-rw-r--r-- | core/mplayer.c | 11 |
1 files changed, 10 insertions, 1 deletions
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 <libavutil/intreadwrite.h> #include <libavutil/attributes.h> +#include <libavcodec/version.h> + #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); |