* modules/packetizer/*: bug fix (use es_format_Copy() when necessary).
authorGildas Bazin <gbazin@videolan.org>
Tue, 13 Apr 2004 10:52:29 +0000 (10:52 +0000)
committerGildas Bazin <gbazin@videolan.org>
Tue, 13 Apr 2004 10:52:29 +0000 (10:52 +0000)
modules/packetizer/copy.c
modules/packetizer/mpeg4video.c

index 8753747..24b8465 100644 (file)
@@ -75,13 +75,7 @@ static int Open( vlc_object_t *p_this )
     p_dec->pf_packetize = Packetize;
 
     /* Create the output format */
     p_dec->pf_packetize = Packetize;
 
     /* Create the output format */
-    memcpy( &p_dec->fmt_out, &p_dec->fmt_in, sizeof( es_format_t ) );
-    if( p_dec->fmt_in.i_extra > 0 )
-    {
-        p_dec->fmt_out.p_extra = malloc( p_dec->fmt_in.i_extra );
-        memcpy( p_dec->fmt_out.p_extra, p_dec->fmt_in.p_extra,
-                p_dec->fmt_in.i_extra );
-    }
+    es_format_Copy( &p_dec->fmt_out, &p_dec->fmt_in );
 
     /* Fix the value of the fourcc */
     switch( p_dec->fmt_in.i_codec )
 
     /* Fix the value of the fourcc */
     switch( p_dec->fmt_in.i_codec )
index 1e85bdc..a400910 100644 (file)
@@ -141,7 +141,7 @@ static int Open( vlc_object_t *p_this )
     p_sys->b_frame = VLC_FALSE;
 
     /* Setup properties */
     p_sys->b_frame = VLC_FALSE;
 
     /* Setup properties */
-    p_dec->fmt_out = p_dec->fmt_in;
+    es_format_Copy( &p_dec->fmt_out, &p_dec->fmt_in );
     p_dec->fmt_out.i_codec = VLC_FOURCC( 'm', 'p', '4', 'v' );
 
     if( p_dec->fmt_in.i_extra )
     p_dec->fmt_out.i_codec = VLC_FOURCC( 'm', 'p', '4', 'v' );
 
     if( p_dec->fmt_in.i_extra )