aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2007-01-14 00:54:03 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2007-01-14 00:54:03 +0000
commitec54839ab1fb10ad692aaf2fad8ea907ebde1446 (patch)
tree0a70790a98d48ce9e747fe598c39f1c50b43ee12
parent69566e4365719a68fd9668e721ddcdfcb95ae5d1 (diff)
downloadffmpeg-ec54839ab1fb10ad692aaf2fad8ea907ebde1446.tar.gz
always export audiostreams
Originally committed as revision 7454 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/swf.c49
1 files changed, 22 insertions, 27 deletions
diff --git a/libavformat/swf.c b/libavformat/swf.c
index 52b7febbf4..df3c71660a 100644
--- a/libavformat/swf.c
+++ b/libavformat/swf.c
@@ -811,35 +811,30 @@ static int swf_read_header(AVFormatContext *s, AVFormatParameters *ap)
get_byte(pb);
v = get_byte(pb);
swf->samples_per_frame = get_le16(pb);
- if (len > 4)
- url_fskip(pb,len-4);
- /* if mp3 streaming found, OK */
- if ((v & 0x20) != 0) {
- ast = av_new_stream(s, 1);
- if (!ast)
- return -ENOMEM;
- av_set_pts_info(ast, 24, 1, 1000); /* 24 bit pts in ms */
-
- ast->codec->channels = 1 + (v&1);
-
- switch((v>> 2) & 0x03) {
- case 1:
- ast->codec->sample_rate = 11025;
- break;
- case 2:
- ast->codec->sample_rate = 22050;
- break;
- case 3:
- ast->codec->sample_rate = 44100;
- break;
- default:
- av_free(ast);
- return AVERROR_IO;
- }
- ast->codec->codec_type = CODEC_TYPE_AUDIO;
+ ast = av_new_stream(s, 1);
+ av_set_pts_info(ast, 24, 1, 1000); /* 24 bit pts in ms */
+ ast->codec->channels = 1 + (v&1);
+ ast->codec->codec_type = CODEC_TYPE_AUDIO;
+ if (v & 0x20)
ast->codec->codec_id = CODEC_ID_MP3;
- ast->need_parsing = 1;
+ ast->need_parsing = 1;
+ switch((v>> 2) & 0x03) {
+ case 1:
+ ast->codec->sample_rate = 11025;
+ break;
+ case 2:
+ ast->codec->sample_rate = 22050;
+ break;
+ case 3:
+ ast->codec->sample_rate = 44100;
+ break;
+ default:
+ return AVERROR_IO;
}
+
+ if (len > 4)
+ url_fskip(pb,len-4);
+
} else {
url_fskip(pb, len);
}