[FFmpeg-soc] [PATCH] xiph packetizer

Ronald S. Bultje rsbultje at gmail.com
Wed Jul 28 16:07:28 CEST 2010


Hi,

On Tue, Jul 27, 2010 at 10:48 PM, Josh Allmann <joshua.allmann at gmail.com> wrote:
> Re-sending, due to this hunk:
>
> @@ -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 = av_clip(s->max_frames_per_packet, 1, 15);
> +        s->max_payload_size -= 6; // ident+frag+tdt/vdt+pkt_num+pkt_length
>     default:
>         if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
>             av_set_pts_info(st, 32, 1, st->codec->sample_rate);
>
> Apparently AAC and AMR both fall through to the default case. Whether
> that's intentional, I don't know, so I moved my stuff to minimize
> behavioral changes to existing code.

You could use goto default (where you would normally use "break") so
that this works for all codecs without randomness.

Ronald


More information about the FFmpeg-soc mailing list