Commit 464b7ce9 authored by bcoudurier's avatar bcoudurier

simplify

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@7465 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 1d70768d
...@@ -800,6 +800,7 @@ static int swf_read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -800,6 +800,7 @@ static int swf_read_header(AVFormatContext *s, AVFormatParameters *ap)
} }
} else if ( ( tag == TAG_STREAMHEAD || tag == TAG_STREAMHEAD2 ) && !ast) { } else if ( ( tag == TAG_STREAMHEAD || tag == TAG_STREAMHEAD2 ) && !ast) {
/* streaming found */ /* streaming found */
int sample_rate_code;
get_byte(pb); get_byte(pb);
v = get_byte(pb); v = get_byte(pb);
swf->samples_per_frame = get_le16(pb); swf->samples_per_frame = get_le16(pb);
...@@ -811,20 +812,10 @@ static int swf_read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -811,20 +812,10 @@ static int swf_read_header(AVFormatContext *s, AVFormatParameters *ap)
if (v & 0x20) if (v & 0x20)
ast->codec->codec_id = CODEC_ID_MP3; ast->codec->codec_id = CODEC_ID_MP3;
ast->need_parsing = 1; ast->need_parsing = 1;
switch((v>> 2) & 0x03) { sample_rate_code= (v>>2) & 3;
case 1: if (!sample_rate_code)
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; return AVERROR_IO;
} ast->codec->sample_rate = 11025 << (sample_rate_code-1);
if (len > 4) if (len > 4)
url_fskip(pb,len-4); url_fskip(pb,len-4);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment