[vlc-devel] commit: Remove all subtitles support for people with old avcodec versions. (Jean-Baptiste Kempf )

git version control git at videolan.org
Fri Aug 28 12:23:34 CEST 2009


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Aug 28 12:18:32 2009 +0200| [7c4b1eb97355b17f4ff3b77147156f6e97f024b5] | committer: Jean-Baptiste Kempf 

Remove all subtitles support for people with old avcodec versions.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7c4b1eb97355b17f4ff3b77147156f6e97f024b5
---

 modules/codec/avcodec/avcodec.c  |    2 ++
 modules/codec/avcodec/subtitle.c |    9 +++------
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/modules/codec/avcodec/avcodec.c b/modules/codec/avcodec/avcodec.c
index 0f621cf..59d4798 100644
--- a/modules/codec/avcodec/avcodec.c
+++ b/modules/codec/avcodec/avcodec.c
@@ -280,11 +280,13 @@ static int OpenDecoder( vlc_object_t *p_this )
         i_result =  InitAudioDec ( p_dec, p_context, p_codec,
                                        i_codec_id, psz_namecodec );
         break;
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 52, 25, 0 )
     case SPU_ES:
         p_dec->pf_decode_sub = DecodeSubtitle;
         i_result =  InitSubtitleDec( p_dec, p_context, p_codec,
                                      i_codec_id, psz_namecodec );
         break;
+#endif
     default:
         i_result = VLC_EGENERIC;
     }
diff --git a/modules/codec/avcodec/subtitle.c b/modules/codec/avcodec/subtitle.c
index 8d51583..1e8047b 100644
--- a/modules/codec/avcodec/subtitle.c
+++ b/modules/codec/avcodec/subtitle.c
@@ -48,6 +48,8 @@
 
 #include "avcodec.h"
 
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 52, 25, 0 )
+
 struct decoder_sys_t {
     FFMPEG_COMMON_MEMBERS
 };
@@ -100,7 +102,6 @@ int InitSubtitleDec(decoder_t *dec, AVCodecContext *context,
  */
 subpicture_t *DecodeSubtitle(decoder_t *dec, block_t **block_ptr)
 {
-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 52, 25, 0 )
     decoder_sys_t *sys = dec->p_sys;
 
     if (!block_ptr || !*block_ptr)
@@ -164,11 +165,6 @@ subpicture_t *DecodeSubtitle(decoder_t *dec, block_t **block_ptr)
     if (!spu)
         block_Release(block);
     return spu;
-#else
-    VLC_UNUSED(dec);
-    VLC_UNUSED(block_ptr);
-    return NULL;
-#endif
 }
 
 /**
@@ -278,3 +274,4 @@ static subpicture_t *ConvertSubtitle(decoder_t *dec, AVSubtitle *ffsub, mtime_t
     return spu;
 }
 
+#endif




More information about the vlc-devel mailing list