summaryrefslogtreecommitdiffstats
path: root/libfaad2/common.c
diff options
context:
space:
mode:
authoralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-10-03 22:23:26 +0000
committeralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-10-03 22:23:26 +0000
commite24087509a752d8f4dcc679b304fc1745ff768b0 (patch)
tree60bbaca1e13f268df83d5d88c1daa49debacc541 /libfaad2/common.c
parent22c9bcf82417c33258c74104704f196f6672f696 (diff)
downloadmpv-e24087509a752d8f4dcc679b304fc1745ff768b0.tar.bz2
mpv-e24087509a752d8f4dcc679b304fc1745ff768b0.tar.xz
synced with current cvs
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10990 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libfaad2/common.c')
-rw-r--r--libfaad2/common.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/libfaad2/common.c b/libfaad2/common.c
index 7c1a1b4434..956e331c32 100644
--- a/libfaad2/common.c
+++ b/libfaad2/common.c
@@ -22,7 +22,7 @@
** Commercial non-GPL licensing of this software is possible.
** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
**
-** $Id: common.c,v 1.6 2003/07/29 08:20:12 menno Exp $
+** $Id: common.c,v 1.1 2003/08/30 22:30:21 arpi Exp $
**/
/* just some common functions that could be used anywhere */
@@ -35,7 +35,6 @@
/* Returns the sample rate index based on the samplerate */
uint8_t get_sr_index(uint32_t samplerate)
{
- if (16428320 <= samplerate) return 11;
if (92017 <= samplerate) return 0;
if (75132 <= samplerate) return 1;
if (55426 <= samplerate) return 2;
@@ -47,10 +46,26 @@ uint8_t get_sr_index(uint32_t samplerate)
if (13856 <= samplerate) return 8;
if (11502 <= samplerate) return 9;
if (9391 <= samplerate) return 10;
+ if (16428320 <= samplerate) return 11;
return 11;
}
+/* Returns the sample rate based on the sample rate index */
+uint32_t get_sample_rate(uint8_t sr_index)
+{
+ static const uint32_t sample_rates[] =
+ {
+ 96000, 88200, 64000, 48000, 44100, 32000,
+ 24000, 22050, 16000, 12000, 11025, 8000
+ };
+
+ if (sr_index < 12)
+ return sample_rates[sr_index];
+
+ return 0;
+}
+
/* Returns 0 if an object type is decodable, otherwise returns -1 */
int8_t can_decode_ot(uint8_t object_type)
{