[vlc-devel] commit: avformat: attachments should still be treated as tracks. this fixes [8c5a9c72318853e165ebb29a1ac49ee079bc4bc5] (Derk-Jan Hartman )

git version control git at videolan.org
Thu Sep 18 16:32:55 CEST 2008


vlc | branch: master | Derk-Jan Hartman <hartman at videolan.org> | Thu Sep 18 16:01:09 2008 +0200| [5da8b1865408748ed602090f160a24a51ac03032] | committer: Derk-Jan Hartman 

avformat: attachments should still be treated as tracks. this fixes [8c5a9c72318853e165ebb29a1ac49ee079bc4bc5]

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

 modules/demux/avformat/demux.c |   42 ++++++++++++++++++++++-----------------
 1 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index afd41ca..84d8bb9 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -214,22 +214,6 @@ int OpenDemux( vlc_object_t *p_this )
         if( !GetVlcFourcc( cc->codec_id, NULL, &fcc, NULL ) )
             fcc = VLC_FOURCC( 'u', 'n', 'd', 'f' );
 
-#ifdef HAVE_FFMPEG_CODEC_ATTACHMENT
-        if( cc->codec_type == CODEC_TYPE_ATTACHMENT )
-        {
-            input_attachment_t *p_attachment;
-            psz_type = "attachment";
-            if( cc->codec_id == CODEC_ID_TTF )
-            {
-                p_attachment = vlc_input_attachment_New( p_sys->ic->streams[i]->filename, "application/x-truetype-font", NULL,
-                                             cc->extradata, (int)cc->extradata_size );
-                TAB_APPEND( p_sys->i_attachments, p_sys->attachments, p_attachment );
-            }
-            else msg_Warn( p_demux, "unsupported attachment type in ffmpeg demux" );
-        }
-        continue; /* Not a real track. nothing left to do here */
-#endif
-
         switch( cc->codec_type )
         {
         case CODEC_TYPE_AUDIO:
@@ -277,6 +261,22 @@ int OpenDemux( vlc_object_t *p_this )
 
         default:
             es_format_Init( &fmt, UNKNOWN_ES, 0 );
+#ifdef HAVE_FFMPEG_CODEC_ATTACHMENT
+            if( cc->codec_type == CODEC_TYPE_ATTACHMENT )
+            {
+                input_attachment_t *p_attachment;
+                psz_type = "attachment";
+                if( cc->codec_id == CODEC_ID_TTF )
+                {
+                    p_attachment = vlc_input_attachment_New( p_sys->ic->streams[i]->filename, "application/x-truetype-font", NULL,
+                                             cc->extradata, (int)cc->extradata_size );
+                    TAB_APPEND( p_sys->i_attachments, p_sys->attachments, p_attachment );
+                }
+                else msg_Warn( p_demux, "unsupported attachment type in ffmpeg demux" );
+            }
+            break;
+#endif
+
             if( cc->codec_type == CODEC_TYPE_DATA )
                 psz_type = "data";
 
@@ -284,8 +284,14 @@ int OpenDemux( vlc_object_t *p_this )
             break;
         }
         fmt.psz_language = strdup( p_sys->ic->streams[i]->language );
-        fmt.i_extra = cc->extradata_size;
-        fmt.p_extra = cc->extradata;
+
+#ifdef HAVE_FFMPEG_CODEC_ATTACHMENT
+        if( cc->codec_type != CODEC_TYPE_ATTACHMENT )
+#endif
+        {
+            fmt.i_extra = cc->extradata_size;
+            fmt.p_extra = cc->extradata;
+        }
         es = es_out_Add( p_demux->out, &fmt );
 
         msg_Dbg( p_demux, "adding es: %s codec = %4.4s",




More information about the vlc-devel mailing list