[FFmpeg-soc] [PATCH] xiph packetizer

Martin Storsjö martin at martin.st
Tue Jul 27 11:54:06 CEST 2010


On Mon, 26 Jul 2010, Ronald S. Bultje wrote:

> Hi,
> 
> On Mon, Jul 26, 2010 at 6:05 AM, Josh Allmann <joshua.allmann at gmail.com> wrote:
> [..]
> > @@ -154,6 +156,11 @@ static int rtp_write_header(AVFormatContext *s1)
> >          }
> >      case CODEC_ID_AAC:
> >          s->num_frames = 0;
> > +    case CODEC_ID_VORBIS:
> > +    case CODEC_ID_THEORA:
> > +        if (!s->max_frames_per_packet || s->max_frames_per_packet > 15)
> > +            s->max_frames_per_packet = 15;
> 
> av_clip()?

Umm, no, that's not what he's doing. But something like this could be 
useful:

if (!max)
    max = 15;
max = av_clip(max, 1, 15);

Since you want both the default-initialization to a sane value, but still 
want to restrict the possible values to a certain range. (This way, you 
won't be able to set negative values.)

// Martin


More information about the FFmpeg-soc mailing list