[FFmpeg-soc] [PATCH] xiph packetizer

Martin Storsjö martin at martin.st
Wed Jul 28 08:49:12 CEST 2010


On Tue, 27 Jul 2010, Josh Allmann 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.

Yes, that's quite intentional. Unfortunately, with that design in the 
switch, it's quite hard to add yet another codec to share the fallback but 
with non-shared codec specific code, as you noticed.

// Martin


More information about the FFmpeg-soc mailing list