Commit cec2759d authored by jbr's avatar jbr

flacdec: add support for 3 additional sample rate codes

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@16723 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent c970d3e9
...@@ -76,7 +76,8 @@ typedef struct FLACContext { ...@@ -76,7 +76,8 @@ typedef struct FLACContext {
#define METADATA_TYPE_STREAMINFO 0 #define METADATA_TYPE_STREAMINFO 0
static const int sample_rate_table[] = static const int sample_rate_table[] =
{ 0, 0, 0, 0, { 0,
88200, 176400, 192000,
8000, 16000, 22050, 24000, 32000, 44100, 48000, 96000, 8000, 16000, 22050, 24000, 32000, 44100, 48000, 96000,
0, 0, 0, 0 }; 0, 0, 0, 0 };
...@@ -558,7 +559,7 @@ static int decode_frame(FLACContext *s, int alloc_data_size) ...@@ -558,7 +559,7 @@ static int decode_frame(FLACContext *s, int alloc_data_size)
if (sample_rate_code == 0){ if (sample_rate_code == 0){
samplerate= s->samplerate; samplerate= s->samplerate;
}else if ((sample_rate_code > 3) && (sample_rate_code < 12)) }else if (sample_rate_code < 12)
samplerate = sample_rate_table[sample_rate_code]; samplerate = sample_rate_table[sample_rate_code];
else if (sample_rate_code == 12) else if (sample_rate_code == 12)
samplerate = get_bits(&s->gb, 8) * 1000; samplerate = get_bits(&s->gb, 8) * 1000;
......
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