[vlc-commits] demux: avformat: map tx3g

Francois Cartegnie git at videolan.org
Fri Jan 5 20:58:46 CET 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Jan  5 14:45:42 2018 +0100| [05b55737f9a91363aa906e71c3b4039e9cc8b78b] | committer: Francois Cartegnie

demux: avformat: map tx3g

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

 modules/codec/avcodec/fourcc.c | 2 +-
 modules/demux/avformat/demux.c | 9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/modules/codec/avcodec/fourcc.c b/modules/codec/avcodec/fourcc.c
index 22761cffa6..4020461218 100644
--- a/modules/codec/avcodec/fourcc.c
+++ b/modules/codec/avcodec/fourcc.c
@@ -470,7 +470,7 @@ static const struct vlc_avcodec_fourcc spu_codecs[] =
     { VLC_CODEC_SUBT, AV_CODEC_ID_TEXT },
     { VLC_CODEC_XSUB, AV_CODEC_ID_XSUB },
     { VLC_CODEC_SSA, AV_CODEC_ID_SSA },
-    /* AV_CODEC_ID_MOV_TEXT */
+    { VLC_CODEC_TX3G, AV_CODEC_ID_MOV_TEXT },
     { VLC_CODEC_BD_PG, AV_CODEC_ID_HDMV_PGS_SUBTITLE },
 #if LIBAVCODEC_VERSION_CHECK( 57, 999, 999, 71, 100 )
     { VLC_CODEC_BD_TEXT, AV_CODEC_ID_HDMV_TEXT_SUBTITLE },
diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index 65d4278ccd..25049650cf 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -498,7 +498,14 @@ int avformat_OpenDemux( vlc_object_t *p_this )
                 es_fmt.subs.dvb.i_id = GetWBE( cp->extradata ) |
                                       (GetWBE( cp->extradata + 2 ) << 16);
             }
-
+            else if( cp->codec_id == AV_CODEC_ID_MOV_TEXT )
+            {
+                if( cp->extradata_size && (es_fmt.p_extra = malloc(cp->extradata_size)) )
+                {
+                    memcpy( es_fmt.p_extra, cp->extradata, cp->extradata_size );
+                    es_fmt.i_extra = cp->extradata_size;
+                }
+            }
             psz_type = "subtitle";
             break;
 



More information about the vlc-commits mailing list