[vlc-devel] commit: Fixed extra data parsing with some VC1 streams. (Laurent Aimar )

git version control git at videolan.org
Tue Apr 28 21:29:39 CEST 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Tue Apr 28 19:26:37 2009 +0200| [7aa5ac93bc54fc1d52a377fb11401b96e709bd7f] | committer: Laurent Aimar 

Fixed extra data parsing with some VC1 streams.

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

 modules/packetizer/vc1.c |   33 +++++++++++++++++++++++----------
 1 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/modules/packetizer/vc1.c b/modules/packetizer/vc1.c
index 9981eaa..e628940 100644
--- a/modules/packetizer/vc1.c
+++ b/modules/packetizer/vc1.c
@@ -155,17 +155,30 @@ static int Open( vlc_object_t *p_this )
 
     p_sys->i_interpolated_dts = -1;
 
-
-    if( p_dec->fmt_in.i_extra > 0 )
+    /* */
+    if( p_dec->fmt_out.i_extra > 0 )
     {
-        block_t *p_init = block_New( p_dec, p_dec->fmt_in.i_extra );
-        block_t *p_pic;
+        uint8_t *p_extra = p_dec->fmt_out.p_extra;
 
-        memcpy( p_init->p_buffer, p_dec->fmt_in.p_extra,
-                p_dec->fmt_in.i_extra );
+        /* With (some) ASF the first byte has to be stripped */
+        if( p_extra[0] != 0x00 )
+        {
+            memcpy( &p_extra[0], &p_extra[1], p_dec->fmt_out.i_extra - 1 );
+            p_dec->fmt_out.i_extra--;
+        }
 
-        while( ( p_pic = Packetize( p_dec, &p_init ) ) )
-            block_Release( p_pic ); /* Should not happen (only sequence header) */
+        /* */
+        if( p_dec->fmt_out.i_extra > 0 )
+        {
+            block_t *p_init = block_New( p_dec, p_dec->fmt_out.i_extra );
+
+            memcpy( p_init->p_buffer, p_dec->fmt_out.p_extra,
+                    p_dec->fmt_out.i_extra );
+
+            block_t *p_pic;
+            while( ( p_pic = Packetize( p_dec, &p_init ) ) )
+                block_Release( p_pic ); /* Should not happen (only sequence header) */
+        }
     }
 
     return VLC_SUCCESS;




More information about the vlc-devel mailing list