]> git.sesse.net Git - vlc/commitdiff
* h264: handle SPS/PPS in annexb format in extra data (needed for RTP).
authorLaurent Aimar <fenrir@videolan.org>
Tue, 19 Jul 2005 08:39:50 +0000 (08:39 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Tue, 19 Jul 2005 08:39:50 +0000 (08:39 +0000)
modules/packetizer/h264.c

index 91c8db5c8c6172df1e6bf2a1f1eaab519b728924..a90b65b134cdd83bc5ba424d69d4e1c0a123e353 100644 (file)
@@ -205,6 +205,22 @@ static int Open( vlc_object_t *p_this )
     {
         /* Set callback */
         p_dec->pf_packetize = Packetize;
+
+        /* */
+        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 );
+            }
+        }
     }
 
     return VLC_SUCCESS;