]> git.sesse.net Git - vlc/commitdiff
* modules/packetizer/mpeg4video.c: ts/ps muxers rely on VOL being present in the...
authorGildas Bazin <gbazin@videolan.org>
Sun, 11 Jun 2006 20:52:08 +0000 (20:52 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sun, 11 Jun 2006 20:52:08 +0000 (20:52 +0000)
modules/packetizer/mpeg4video.c

index 924e17fb4a56b384a12472dded05a1c0aed47281..fdffce8b2ca28ce831e6eb5ce46adb41d04ee441 100644 (file)
@@ -336,22 +336,37 @@ static block_t *ParseMPEGBlock( decoder_t *p_dec, block_t *p_frag )
 
     if( p_frag->p_buffer[3] == 0xB0 || p_frag->p_buffer[3] == 0xB1 )
     {
+#if 0
         /* Remove VOS start/end code from the original stream */
         block_Release( p_frag );
+#else
+        /* Append the block for now since ts/ps muxers rely on VOL
+         * being present in the stream */
+        block_ChainLastAppend( &p_sys->pp_last, p_frag );
+#endif
         return NULL;
     }
     if( p_frag->p_buffer[3] >= 0x20 && p_frag->p_buffer[3] <= 0x2f )
     {
         /* Copy the complete VOL */
-        p_dec->fmt_out.i_extra = p_frag->i_buffer;
-        p_dec->fmt_out.p_extra =
-            realloc( p_dec->fmt_out.p_extra, p_dec->fmt_out.i_extra );
+        if( p_dec->fmt_out.i_extra != p_frag->i_buffer )
+        {
+            p_dec->fmt_out.p_extra =
+                realloc( p_dec->fmt_out.p_extra, p_frag->i_buffer );
+            p_dec->fmt_out.i_extra = p_frag->i_buffer;
+        }
         memcpy( p_dec->fmt_out.p_extra, p_frag->p_buffer, p_frag->i_buffer );
         ParseVOL( p_dec, &p_dec->fmt_out,
                   p_dec->fmt_out.p_extra, p_dec->fmt_out.i_extra );
 
+#if 0
         /* Remove from the original stream */
         block_Release( p_frag );
+#else
+        /* Append the block for now since ts/ps muxers rely on VOL
+         * being present in the stream */
+        block_ChainLastAppend( &p_sys->pp_last, p_frag );
+#endif
         return NULL;
     }
     else