[SCM] xbmc/libav: Define AV_CODEC_ID_SUBRIP to AV_CODEC_ID_TEXT in libav hacks and fix compilation

rbalint at users.alioth.debian.org rbalint at users.alioth.debian.org
Wed May 21 22:29:23 UTC 2014


The following commit has been merged in the libav branch:
commit bffb887a8d1137b26ca2605734c4c03673a40b42
Author: Balint Reczey <balint at balintreczey.hu>
Date:   Wed May 21 23:48:37 2014 +0200

    Define AV_CODEC_ID_SUBRIP to AV_CODEC_ID_TEXT in libav hacks and fix compilation

diff --git a/lib/xbmc-libav-hacks/libav_hacks.h b/lib/xbmc-libav-hacks/libav_hacks.h
index a315c05..af64980 100644
--- a/lib/xbmc-libav-hacks/libav_hacks.h
+++ b/lib/xbmc-libav-hacks/libav_hacks.h
@@ -45,7 +45,7 @@
 #define AVFRAME_IN_LAVU
 
 #define AV_CODEC_ID_OTF AV_CODEC_ID_TTF
-#define AV_CODEC_ID_SUBRIP  AV_CODEC_ID_FIRST_SUBTITLE
+#define AV_CODEC_ID_SUBRIP AV_CODEC_ID_TEXT
 
 AVDictionary *av_frame_get_metadata       (const AVFrame *frame);
 
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
index a7445d3..dcb7534 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
+++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
@@ -391,10 +391,17 @@ CDVDOverlayCodec* CDVDFactoryCodec::CreateOverlayCodec( CDVDStreamInfo &hint )
   CDVDOverlayCodec* pCodec = NULL;
   CDVDCodecOptions options;
 
+  // not all FFmpeg versions have AV_CODEC_ID_SUBRIP
+  // But when they have it, it works like AV_CODEC_ID_TEXT here
+  if (AV_CODEC_ID_SUBRIP == hint.codec) {
+    pCodec = OpenCodec(new CDVDOverlayCodecText(), hint, options);
+    if( pCodec ) return pCodec;
+    return NULL;
+  }
+
   switch (hint.codec)
   {
     case AV_CODEC_ID_TEXT:
-    case AV_CODEC_ID_SUBRIP:
       pCodec = OpenCodec(new CDVDOverlayCodecText(), hint, options);
       if( pCodec ) return pCodec;
       break;

-- 
xbmc packaging



More information about the pkg-multimedia-commits mailing list