[FFmpeg-devel] [PATCH] fix swf playback with bad audio track
Baptiste Coudurier
baptiste.coudurier
Tue Sep 11 01:20:23 CEST 2007
Hi
Aurelien Jacobs wrote:
> Hi,
>
> 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 ?
> With the attached patch, the swf demuxer simply ignore the unrecognized
> audio track, but still allows to play the video track of such a file.
>
> Aurel
>
>
> ------------------------------------------------------------------------
>
> Index: libavformat/swf.c
> ===================================================================
> --- libavformat/swf.c (revision 10438)
> +++ libavformat/swf.c (working copy)
> @@ -682,17 +682,17 @@
> get_byte(pb);
> v = get_byte(pb);
> swf->samples_per_frame = get_le16(pb);
> + sample_rate_code= (v>>2) & 3;
> + if (sample_rate_code) {
> ast = av_new_stream(s, -1); /* -1 to avoid clash with video stream ch_id */
> swf->audio_stream_index = ast->index;
> ast->codec->channels = 1 + (v&1);
> ast->codec->codec_type = CODEC_TYPE_AUDIO;
> ast->codec->codec_id = codec_get_id(swf_audio_codec_tags, (v>>4) & 15);
> ast->need_parsing = AVSTREAM_PARSE_FULL;
> - sample_rate_code= (v>>2) & 3;
> - if (!sample_rate_code)
> - return AVERROR(EIO);
> ast->codec->sample_rate = 11025 << (sample_rate_code-1);
> av_set_pts_info(ast, 64, 1, ast->codec->sample_rate);
> + }
> len -= 4;
> } else if (tag == TAG_VIDEOFRAME) {
> int ch_id = get_le16(pb);
>
Im not against it, though maybe we should still export the track, to
permit stream copy/extraction somehow. I'd like to know which codec it
is supposed to be.
--
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