]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/swfdec.c
apedec: av_fast_malloc() instead of av_realloc()
[ffmpeg] / libavformat / swfdec.c
index 1fc301b69623653e7ac408416c3dced3a8026a85..1bcb24919d7f75ec2e764a733797a1de77cd1a7a 100644 (file)
@@ -52,7 +52,7 @@ static int swf_probe(AVProbeData *p)
         return 0;
 }
 
-static int swf_read_header(AVFormatContext *s, AVFormatParameters *ap)
+static int swf_read_header(AVFormatContext *s)
 {
     SWFContext *swf = s->priv_data;
     AVIOContext *pb = s->pb;
@@ -137,10 +137,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
             ast->codec->codec_id = ff_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)
-                ast->codec->sample_rate = 5512;
-            else
-                ast->codec->sample_rate = 11025 << (sample_rate_code-1);
+            ast->codec->sample_rate = 44100 >> (3 - sample_rate_code);
             avpriv_set_pts_info(ast, 64, 1, ast->codec->sample_rate);
             len -= 4;
         } else if (tag == TAG_VIDEOFRAME) {