[vlc-devel] commit: Allowed GetFfmpegCodec() to convert more subtitle codecs. ( Laurent Aimar )
git version control
git at videolan.org
Sat Feb 20 14:13:07 CET 2010
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sat Feb 20 13:36:36 2010 +0100| [7dfc8992f2f8fd90418ebfb977a8498cb6e12c9c] | committer: Laurent Aimar
Allowed GetFfmpegCodec() to convert more subtitle codecs.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7dfc8992f2f8fd90418ebfb977a8498cb6e12c9c
---
modules/codec/avcodec/fourcc.c | 2 --
modules/codec/avcodec/subtitle.c | 9 +++++++++
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/modules/codec/avcodec/fourcc.c b/modules/codec/avcodec/fourcc.c
index b9eb056..96fab55 100644
--- a/modules/codec/avcodec/fourcc.c
+++ b/modules/codec/avcodec/fourcc.c
@@ -408,7 +408,6 @@ 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 },
@@ -416,7 +415,6 @@ static const struct
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 50, 0 )
{ VLC_CODEC_SSA, CODEC_ID_SSA, SPU_ES },
#endif
-#endif
{ 0, 0, UNKNOWN_ES }
};
diff --git a/modules/codec/avcodec/subtitle.c b/modules/codec/avcodec/subtitle.c
index 89fad76..d46435c 100644
--- a/modules/codec/avcodec/subtitle.c
+++ b/modules/codec/avcodec/subtitle.c
@@ -65,6 +65,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)
return VLC_ENOMEM;
More information about the vlc-devel
mailing list