[vlc-devel] [PATCH 1/1] Add support for DivX XSUB subtitle streams.

Jai Menon jmenon86 at gmail.com
Wed May 26 13:32:20 CEST 2010


---
 modules/codec/avcodec/subtitle.c |    1 +
 modules/demux/avi/avi.c          |    2 ++
 modules/demux/avi/libavi.h       |    2 ++
 3 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/modules/codec/avcodec/subtitle.c b/modules/codec/avcodec/subtitle.c
index 20284b2..205e02b 100644
--- a/modules/codec/avcodec/subtitle.c
+++ b/modules/codec/avcodec/subtitle.c
@@ -66,6 +66,7 @@ int InitSubtitleDec(decoder_t *dec, AVCodecContext *context,
     /* */
     switch (codec_id) {
     case CODEC_ID_HDMV_PGS_SUBTITLE:
+    case CODEC_ID_XSUB:
         break;
     default:
         msg_Warn(dec, "refusing to decode non validated subtitle codec");
diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index 55d794a..b522217 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -450,6 +450,7 @@ static int Open( vlc_object_t * p_this )
                 {
                    msg_Dbg( p_demux, "stream[%d] subtitles", i );
                    es_format_Init( &fmt, SPU_ES, p_vids->p_bih->biCompression );
+                   tk->i_cat = SPU_ES;
                    break;
                 }
                 else if( p_vids->p_bih->biCompression == 0x00 )
@@ -1921,6 +1922,7 @@ static void AVI_ParseStreamHeader( vlc_fourcc_t i_id,
                 SET_PTR( pi_type, VIDEO_ES );
                 break;
             case AVITWOCC_tx:
+            case AVITWOCC_sb:
                 SET_PTR( pi_type, SPU_ES );
                 break;
             default:
diff --git a/modules/demux/avi/libavi.h b/modules/demux/avi/libavi.h
index a9510c4..3862cf9 100644
--- a/modules/demux/avi/libavi.h
+++ b/modules/demux/avi/libavi.h
@@ -300,6 +300,8 @@ void    AVI_ChunkFreeRoot( stream_t *, avi_chunk_t  *p_chk );
 #define AVITWOCC_pc            VLC_TWOCC('p','c')
 #define AVITWOCC_AC            VLC_TWOCC('A','C')
 #define AVITWOCC_tx            VLC_TWOCC('t','x')
+#define AVITWOCC_sb            VLC_TWOCC('s','b')
+
     /* *** codex stuff ***  */
 
     /* DV */
-- 
1.7.0.5




More information about the vlc-devel mailing list