diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-09-30 07:52:37 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-09-30 07:52:37 +0000 |
commit | 0b8508274cb5c836c04c403bd79728ebe528f666 (patch) | |
tree | 9ce3b70789220cc824d1299a0137b0bd534a8534 /libmpdemux | |
parent | 640d819512dc8fd56952426a3ce028eab9b35bf5 (diff) |
Simplify aac_get_sample_rate_index
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29739 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/demux_mkv.c | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/libmpdemux/demux_mkv.c b/libmpdemux/demux_mkv.c index cb23da7301..0d18584258 100644 --- a/libmpdemux/demux_mkv.c +++ b/libmpdemux/demux_mkv.c @@ -257,30 +257,10 @@ add_cluster_position (mkv_demuxer_t *mkv_d, uint64_t position) static int aac_get_sample_rate_index (uint32_t sample_rate) { - if (92017 <= sample_rate) - return 0; - else if (75132 <= sample_rate) - return 1; - else if (55426 <= sample_rate) - return 2; - else if (46009 <= sample_rate) - return 3; - else if (37566 <= sample_rate) - return 4; - else if (27713 <= sample_rate) - return 5; - else if (23004 <= sample_rate) - return 6; - else if (18783 <= sample_rate) - return 7; - else if (13856 <= sample_rate) - return 8; - else if (11502 <= sample_rate) - return 9; - else if (9391 <= sample_rate) - return 10; - else - return 11; + static const int srates[] = {92017, 75132, 55426, 46009, 37566, 27713, 23004, 18783, 13856, 11502, 9391, 0}; + int i = 0; + while (sample_rate < srates[i]) i++; + return i; } /** \brief Free cached demux packets |