[FFmpeg-devel] [PATCH] QCELP decoder
Kenan Gillet
kenan.gillet
Sat Oct 4 03:26:51 CEST 2008
Hi,
On Oct 3, 2008, at 4:43 PM, Baptiste Coudurier wrote:
> Hi,
>
> Kenan Gillet wrote:
>> [...]
>>
>> +*/
>> +static int qcelp_decode_init(AVCodecContext *avctx) {
>> + QCELPContext *q = avctx->priv_data;
>> + int i;
>> +
>> + if (avctx->sample_rate != 8000) {
>> + if (avctx->sample_rate == 22050 ||
>> + avctx->sample_rate == 11025) {
>> + av_log(avctx, AV_LOG_WARNING,
>> + "Unofficial samplerate %d, but supported by
>> Quicktime.", avctx->sample_rate);
>> + } else {
>> + av_log(avctx, AV_LOG_WARNING,
>> + "Unsupported samplerate %d, resampling.", avctx-
>> >sample_rate);
>> + avctx->sample_rate= 8000;
>> + }
>> + }
>
> It seems the qualcomm quicktime decoder supports more sampling rate
> than
> these:
> http://sketchup.google.com/gsu6vtvideos.html
>
> Some are 24 khz, and it seems decoder kinda works with these files.
>
> [...]
It seems that setting the sample_rate in AVCodecContext
from the qcelp_decode_init function has no effect on how
FFmpeg 'sees' the sample_rate.
That explains why the 24khz sample kinda works ;)
Is it the expected behavior ?
If it is, it seems the only place to change the sample_rate in
AVCodecContext is to do it in libavcodec/mov.c.
Until now, all the files I came across had a valid sample_rate,
so maybe we can just drop this check and warning.
What would be the usual policy?
Kenan
More information about the ffmpeg-devel
mailing list