[FFmpeg-cvslog] r15536 - trunk/libavformat/mov.c

Baptiste Coudurier baptiste.coudurier
Sat Oct 4 03:34:12 CEST 2008


Michael Niedermayer wrote:
> On Fri, Oct 03, 2008 at 09:37:42PM +0200, bcoudurier wrote:
>> Author: bcoudurier
>> Date: Fri Oct  3 21:37:41 2008
>> New Revision: 15536
>>
>> Log:
>> set sample rate for amr to allow stream copy since no decoder is present,
>> 3gp does not store sample rate in stsd in fact. Fixes #674.
>>
>>
>> Modified:
>>    trunk/libavformat/mov.c
>>
>> Modified: trunk/libavformat/mov.c
>> ==============================================================================
>> --- trunk/libavformat/mov.c	(original)
>> +++ trunk/libavformat/mov.c	Fri Oct  3 21:37:41 2008
>> @@ -991,6 +991,9 @@ static int mov_read_stsd(MOVContext *c, 
>>      case CODEC_ID_AMR_WB:
>>          st->codec->frame_size= sc->samples_per_frame;
>>          st->codec->channels= 1; /* really needed */
>> +        /* force sample rate for amr, stsd in 3gp does not store sample rate */
>> +        if (st->codec->codec_id != CODEC_ID_QCELP)
>> +            st->codec->sample_rate = 8000;
>>          break;
> 
> I was wondering if not maybe something like
> if(!st->codec->sample_rate)
>     st->codec->sample_rate = 8000;

This would only work if sample_rate is not set previously when reading
stsd, I agree setting it is not correct in some cases, however, I fear
indentifing 3gp in all cases will be complicated even with brands, and
in most cases timescale/sample_rate is correctly set to sample rate like
suggested in specs (but not mandatory).

> or
> if(3gp)
>     st->codec->sample_rate = 8000;
> would be cleaner ?

Humm aac in 3gp may not be 8000 :/

In the end, I was thinking that the code was this way since a long time,
and definitely amrnb and amrwb only support mono 8000 hz, so I decided
to go for this solution.

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
Smartjog USA Inc.                                http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA




More information about the ffmpeg-cvslog mailing list