diff rtpenc.c @ 6136:6c0e0ad77315 libavformat

If the video stream is H.264 with MP4 syntax, store the NAL lenght size in the RTP muxer context (it will be used later for splitting frames in NALs)
author lucabe
date Wed, 16 Jun 2010 12:59:47 +0000
parents 201152a121b5
children 397ef451b549
line wrap: on
line diff
--- a/rtpenc.c	Tue Jun 15 19:53:15 2010 +0000
+++ b/rtpenc.c	Wed Jun 16 12:59:47 2010 +0000
@@ -131,6 +131,13 @@
         s->max_payload_size = n * TS_PACKET_SIZE;
         s->buf_ptr = s->buf;
         break;
+    case CODEC_ID_H264:
+        /* check for H.264 MP4 syntax */
+        if (st->codec->extradata_size > 0 && st->codec->extradata &&
+            st->codec->extradata[0] == 1) {
+            s->nal_length_size = (st->codec->extradata[4] & 0x03) + 1;
+        }
+        break;
     case CODEC_ID_AMR_NB:
     case CODEC_ID_AMR_WB:
         if (!s->max_frames_per_packet)