[FFmpeg-devel] [PATCH] RTP depacketizer for AMR

Martin Storsjö martin
Mon Feb 8 21:50:08 CET 2010


Hi,

On Mon, 8 Feb 2010, Ronald S. Bultje wrote:

> Minor nitpicking-time:
> 
> > +    /* Count the number of frames in the packet. The highest bit
> > +     * is set in a TOC byte if there are more frames following.
> > +     */
> > +    while (1 + frames < len && (buf[1 + frames] & 0x80))
> > +        frames++;
> > +    frames++;
> 
> int frames = 0;
> [..]
> do {
>     frames++;
> } while (frames < len && buf[frames] & 0x80);
> 
> is shorter. You could also use for() since it has a clear increment/start/stop:
> 
> int frames;
> [..]
> for (frames = 1; frames < ln && buf[frames] & 0x80; frames++) ;

Ok, implemented this one.

Updated patch attached, with only this change (plus updating to latest 
SVN) compared to the previous one.

// Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtpdec-amr.patch
Type: text/x-diff
Size: 10315 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100208/2f61b626/attachment.patch>



More information about the ffmpeg-devel mailing list