[FFmpeg-cvslog] r23625 - in trunk/libavformat: rtpenc.c rtpenc.h

Benoit Fouet benoit.fouet
Wed Jun 16 15:17:54 CEST 2010


On Wed, 16 Jun 2010 14:59:48 +0200 (CEST) lucabe wrote:
> Author: lucabe
> Date: Wed Jun 16 14:59:47 2010
> New Revision: 23625
> 
> Log:
> 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)
> 
> Modified:
>    trunk/libavformat/rtpenc.c
>    trunk/libavformat/rtpenc.h
> 
> Modified: trunk/libavformat/rtpenc.c
> ==============================================================================
> --- trunk/libavformat/rtpenc.c	Wed Jun 16 12:35:56 2010	(r23624)
> +++ trunk/libavformat/rtpenc.c	Wed Jun 16 14:59:47 2010	(r23625)
> @@ -131,6 +131,13 @@ static int rtp_write_header(AVFormatCont
>          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) {

aren't the two first ones redundant?

> +            s->nal_length_size = (st->codec->extradata[4] & 0x03) + 1;
> +        }

BTW, why not:
if (st->codec->extradata_size > 4 && 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)
> 

Ben



More information about the ffmpeg-cvslog mailing list