]> git.sesse.net Git - vlc/commitdiff
Allowed GetFfmpegCodec() to convert more subtitle codecs.
authorLaurent Aimar <fenrir@videolan.org>
Sat, 20 Feb 2010 12:36:36 +0000 (13:36 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Sat, 20 Feb 2010 13:11:25 +0000 (14:11 +0100)
modules/codec/avcodec/fourcc.c
modules/codec/avcodec/subtitle.c

index b9eb056d5fe3ed90c091862067f15e86c69e13f7..96fab558a986f616e29d2170868dd9819afa4017 100644 (file)
@@ -408,14 +408,12 @@ static const struct
 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 52, 33, 0 )
     { VLC_CODEC_BD_PG, CODEC_ID_HDMV_PGS_SUBTITLE, SPU_ES },
 #endif
-#if 0
     { VLC_CODEC_SPU, CODEC_ID_DVD_SUBTITLE, SPU_ES },
     { VLC_CODEC_DVBS, CODEC_ID_DVB_SUBTITLE, SPU_ES },
     { VLC_CODEC_SUBT, CODEC_ID_TEXT, SPU_ES },
     { VLC_CODEC_XSUB, CODEC_ID_XSUB, SPU_ES },
 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 50, 0 )
     { VLC_CODEC_SSA, CODEC_ID_SSA, SPU_ES },
-#endif
 #endif
 
     { 0, 0, UNKNOWN_ES }
index 89fad764785bcafd6dfb710f798f73d69944a314..d46435c11dc317699e3eeddf9312a90842d76024 100644 (file)
@@ -64,6 +64,15 @@ int InitSubtitleDec(decoder_t *dec, AVCodecContext *context,
 {
     decoder_sys_t *sys;
 
+    /* */
+    switch (codec_id) {
+    case CODEC_ID_HDMV_PGS_SUBTITLE:
+        break;
+    default:
+        msg_Warn(dec, "refusing to decode non validated subtitle codec");
+        return VLC_EGENERIC;
+    }
+
     /* */
     dec->p_sys = sys = malloc(sizeof(*sys));
     if (!sys)