[FFmpeg-devel] [PATCH] fix swf playback with bad audio track

Baptiste Coudurier baptiste.coudurier
Tue Sep 11 14:04:40 CEST 2007


Hi

Reimar D?ffinger wrote:
> Hello,
> On Tue, Sep 11, 2007 at 11:24:15AM +0200, Aurelien Jacobs wrote:
>> On Tue, 11 Sep 2007 01:20:23 +0200
>> Baptiste Coudurier <baptiste.coudurier at smartjog.com> wrote:
>>> Aurelien Jacobs wrote:
>>>> Right now, when the swf demuxer find an audio track with unrecognized
>>>> samplerate, it simply return AVERROR(EIO). This prevent playing the
>>>> video track.
>>> It seems weird, samplerate should not be "unrecognized", Im curious, is
>>> such a file available somewhere ?
>> To be more precise, sample_rate_code has 2 significant bits. Values
>> between 1 and 3 maps to samplerate 11025, 22050 and 44100. 
>> sample_rate_code == 0 don't map to any samplerate (at least in current
>> code).
>> Here is a sample which has sample_rate_code = 0:
>>   http://samples.mplayerhq.hu/SWF/962_fws.swf
> 
> I don't quite get why it should fail at all, mp3 and probably most
> other audio codecs just don't need a sample rate from the container.
> IMO just replace
> 
>>   if (!sample_rate_code)
>>       return AVERROR(EIO);
>>   ast->codec->sample_rate = 11025 << (sample_rate_code-1);
> 
> by
> 
>>   if (sample_rate_code)
>>       ast->codec->sample_rate = 11025 << (sample_rate_code-1);
> 
> and change nothing else.
> 

No, according to specs 0 is 5.5khz sample rate. Code must be fixed
accordingly, and not failing.

Now concerning the sample, it uses DEFINESOUND tag which is a block a
sound data, ie all mp3 frames are in one block, so demuxer must
interleave those frames with video frames. This is not supported atm.

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
SMARTJOG S.A.                                    http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312




More information about the ffmpeg-devel mailing list