changeset 25659:706d6ecf3c7c

Add libass support to demux_lavf.
author eugeni
date Sat, 12 Jan 2008 01:14:45 +0000
parents 0d0c48ecba90
children 3993c96eaa95
files libmpdemux/demux_lavf.c
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_lavf.c	Sat Jan 12 01:12:39 2008 +0000
+++ b/libmpdemux/demux_lavf.c	Sat Jan 12 01:14:45 2008 +0000
@@ -393,16 +393,26 @@
         }
         case CODEC_TYPE_SUBTITLE:{
             sh_sub_t* sh_sub;
+            char type;
             if(priv->sub_streams >= MAX_S_STREAMS)
                 break;
             /* only support text subtitles for now */
-            if(codec->codec_id != CODEC_ID_TEXT)
+            if(codec->codec_id == CODEC_ID_TEXT)
+                type = 't';
+            else if(codec->codec_id == CODEC_ID_SSA)
+                type = 'a';
+            else
                 break;
             sh_sub = new_sh_sub_sid(demuxer, i, priv->sub_streams);
             mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_SubtitleID, "lavf", priv->sub_streams);
             if(!sh_sub) break;
             priv->sstreams[priv->sub_streams] = i;
-            sh_sub->type = 't';
+            sh_sub->type = type;
+            if (codec->extradata_size) {
+                sh_sub->extradata = malloc(codec->extradata_size);
+                memcpy(sh_sub->extradata, codec->extradata, codec->extradata_size);
+                sh_sub->extradata_len = codec->extradata_size;
+            }
             demuxer->sub->sh = demuxer->s_streams[priv->sub_streams++];
             break;
         }