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

Vladimir Voroshilov voroshil
Tue Jun 9 18:34:45 CEST 2009


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 ?


-- 
Regards,
Vladimir Voroshilov     mailto:voroshil at gmail.com
JID: voroshil at gmail.com, voroshil at jabber.ru
ICQ: 95587719



More information about the ffmpeg-devel mailing list