aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/rtpenc.c
diff options
context:
space:
mode:
authorLuca Abeni <lucabe72@email.it>2010-06-16 12:59:47 +0000
committerLuca Abeni <lucabe72@email.it>2010-06-16 12:59:47 +0000
commit8b889b34802dd03115dc1bbadbbe1f415ae8c861 (patch)
tree8cd8ac387d63ebfeaab39da5612dba793b6e1224 /libavformat/rtpenc.c
parented00fe49d7aec2d7899b8f24ef0f5a7d590293f8 (diff)
downloadffmpeg-8b889b34802dd03115dc1bbadbbe1f415ae8c861.tar.gz
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) Originally committed as revision 23625 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtpenc.c')
-rw-r--r--libavformat/rtpenc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c
index 3111c2b32e..5abd490cc4 100644
--- a/libavformat/rtpenc.c
+++ b/libavformat/rtpenc.c
@@ -131,6 +131,13 @@ static int rtp_write_header(AVFormatContext *s1)
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)