[FFmpeg-devel] [PATCH] G.729 initialization routine (skeleton)

Diego Biurrun diego
Tue Jun 9 18:55:55 CEST 2009


On Tue, Jun 09, 2009 at 11:34:45PM +0700, Vladimir Voroshilov wrote:
> 2009/6/9 Diego Biurrun <diego at biurrun.de>:
> > On Tue, Jun 09, 2009 at 11:30:17PM +0700, Vladimir Voroshilov wrote:
> >> 2009/6/9 Michael Niedermayer <michaelni at gmx.at>:
> >> > On Sun, Jun 07, 2009 at 12:28:37AM +0700, Vladimir Voroshilov wrote:
> >> >> + ? ?if (avctx->sample_rate == 8000) {
> >> >> + ? ? ? ?ctx->subframe_size = 40;
> >> >> +#ifdef G729_SUPPORT_4400
> >> >> + ? ?} else if (avctx->sample_rate == 4400) {
> >> >> + ? ? ? ?ctx->subframe_size = 44;
> >> >> +#endif
> >> >> + ? ?} else {
> >> >> + ? ? ? ?av_log(avctx, AV_LOG_ERROR, "Sample rate %d is not supported.\n", avctx->sample_rate);
> >> >> + ? ? ? ?return AVERROR_NOFMT;
> >> >> + ? ?}
> >> >
> >> > ? ?ctx->subframe_size = 40;
> >> > #ifdef G729_SUPPORT_4400
> >> > ? ?if (avctx->sample_rate == 4400) {
> >> > ? ? ? ?ctx->subframe_size = 44;
> >> > ? ?}
> >> > #endif
> >>
> >> In this casse you'll get garbage sound instead of meanfull error
> >> message for unsupported g.729 modes.
> >
> > How? ?It looks like a purely syntactical change to me. ?You could also
> > drop the {}.
> >
> 
> What will happen if sample_rate==6500  in my code and in suggested ?
> Imho, mine will show error, while suggested code will silently try to
> use samplerate==6500.
> Am i missed something ?

No, I am, forget my comment :)

Diego



More information about the ffmpeg-devel mailing list