aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Sommer <saschasommer@freenet.de>2009-06-12 15:38:11 +0000
committerSascha Sommer <saschasommer@freenet.de>2009-06-12 15:38:11 +0000
commit523c09ca4462dcf6a71f7ce39ae373551d5e2225 (patch)
tree89e8e0673b6c35b218a54b5477ba7e1d33eb2b22
parenteff9011d1792104de527584df7685ec42fc1eb6b (diff)
downloadffmpeg-523c09ca4462dcf6a71f7ce39ae373551d5e2225.tar.gz
Add additional sample rates to the frame len bits calculation code
Originally committed as revision 19169 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/wma.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/libavcodec/wma.c b/libavcodec/wma.c
index 00893ab8ee..7698181fd3 100644
--- a/libavcodec/wma.c
+++ b/libavcodec/wma.c
@@ -80,8 +80,24 @@ int av_cold ff_wma_get_frame_len_bits(int sample_rate, int version,
else if (sample_rate <= 22050 ||
(sample_rate <= 32000 && version == 1))
frame_len_bits = 10;
- else
+ else if (sample_rate <= 48000) {
frame_len_bits = 11;
+ } else if (sample_rate <= 96000) {
+ frame_len_bits = 12;
+ } else {
+ frame_len_bits = 13;
+ }
+
+ if (version == 3) {
+ int tmp = decode_flags & 0x6;
+ if (tmp == 0x2) {
+ ++frame_len_bits;
+ } else if (tmp == 0x4) {
+ --frame_len_bits;
+ } else if (tmp == 0x6) {
+ frame_len_bits -= 2;
+ }
+ }
return frame_len_bits;
}