swfdec: Add support for sample_rate_code 0 (5512 Hz)
[ffmpeg.git] / libavformat / swfdec.c
index 59977a94a6dc72edd743ca55e453f1df9c0c263d..502647f9a2740a3c81936c8194d2e157f00c6958 100644 (file)
@@ -136,8 +136,9 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
             ast->need_parsing = AVSTREAM_PARSE_FULL;
             sample_rate_code= (v>>2) & 3;
             if (!sample_rate_code)
             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);
+                ast->codec->sample_rate = 5512;
+            else
+                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) {
             av_set_pts_info(ast, 64, 1, ast->codec->sample_rate);
             len -= 4;
         } else if (tag == TAG_VIDEOFRAME) {