From 009fcba7489883bead0ff13b1cbecf9ccfea2140 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 7 Sep 2015 18:59:03 +0200 Subject: [PATCH] lib/libdvbsub/dvbsubtitle.cpp: fix compil for new ffmpeg version --- lib/libdvbsub/dvbsubtitle.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/libdvbsub/dvbsubtitle.cpp b/lib/libdvbsub/dvbsubtitle.cpp index 26134b02d..d480f6299 100644 --- a/lib/libdvbsub/dvbsubtitle.cpp +++ b/lib/libdvbsub/dvbsubtitle.cpp @@ -25,6 +25,12 @@ extern "C" { #include #include "Debug.hpp" +#if LIBAVCODEC_VERSION_INT <= AV_VERSION_INT(57, 1, 99) + #define CODEC_DVB_SUB CODEC_ID_DVB_SUBTITLE +#else + #define CODEC_DVB_SUB AV_CODEC_ID_DVB_SUBTITLE +#endif + // Set these to 'true' for debug output: static bool DebugConverter = true; @@ -178,7 +184,7 @@ cDvbSubtitleConverter::cDvbSubtitleConverter(void) avcodec = NULL; avcodec_register_all(); - avcodec = avcodec_find_decoder(CODEC_ID_DVB_SUBTITLE); + avcodec = avcodec_find_decoder(CODEC_DVB_SUB);//CODEC_ID_DVB_SUBTITLE or AV_CODEC_ID_DVB_SUBTITLE from 57.1.100 if (!avcodec) { dbgconverter("cDvbSubtitleConverter: unable to get dvb subtitle codec!\n"); return;