]> git.sesse.net Git - vlc/blobdiff - modules/packetizer/h264.c
Fix potential object leak.
[vlc] / modules / packetizer / h264.c
index d1f7f882621f45738206c39d0538576737a932da..534ee7bcbe6f58954dea56a0eba722a09b851456 100644 (file)
@@ -355,19 +355,8 @@ static int Open( vlc_object_t *p_this )
 
         /* */
         if( p_dec->fmt_in.i_extra > 0 )
-        {
-            block_t *p_init = block_New( p_dec, p_dec->fmt_in.i_extra );
-            block_t *p_pic;
-
-            memcpy( p_init->p_buffer, p_dec->fmt_in.p_extra,
-                    p_dec->fmt_in.i_extra );
-
-            while( ( p_pic = Packetize( p_dec, &p_init ) ) )
-            {
-                /* Should not occur because we should only receive SPS/PPS */
-                block_Release( p_pic );
-            }
-        }
+            packetizer_Header( &p_sys->packetizer,
+                               p_dec->fmt_in.p_extra, p_dec->fmt_in.i_extra );
     }
 
     return VLC_SUCCESS;