[FFmpeg-devel] [PATCH] fix swf playback with bad audio track
Reimar Döffinger
Reimar.Doeffinger
Tue Sep 11 13:43:19 CEST 2007
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.
Greetings,
Reimar D?ffinger
More information about the ffmpeg-devel
mailing list