diff options
author | jstebbins <[email protected]> | 2010-10-08 20:50:29 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2010-10-08 20:50:29 +0000 |
commit | 510bf62ed599bcab9d96a3186283b1e6a5417921 (patch) | |
tree | ad3091976d929f736a1afacc4b8b0e0fa6be7b8b /libhb | |
parent | db3be3933c2b8eaf9df838028d065b847f987512 (diff) |
fix some audio bitrate limits issues with ca aac
and choose the next lower bitrate rather than next higher when
between 2 valid rates.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3581 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/common.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libhb/common.c b/libhb/common.c index 7b7e4d5e1..42ed2e547 100644 --- a/libhb/common.c +++ b/libhb/common.c @@ -85,10 +85,10 @@ int hb_find_closest_audio_bitrate(int bitrate) // result is highest rate if none found during search. // rate returned will always be <= rate asked for. - result = hb_audio_bitrates[hb_audio_bitrates_count-1].rate; - for (ii = 0; ii < hb_audio_bitrates_count; ii++) + result = hb_audio_bitrates[0].rate; + for (ii = hb_audio_bitrates_count-1; ii >= 0; ii++) { - if (bitrate <= hb_audio_bitrates[ii].rate) + if (bitrate >= hb_audio_bitrates[ii].rate) { result = hb_audio_bitrates[ii].rate; break; @@ -111,11 +111,11 @@ void hb_get_audio_bitrate_limits(uint32_t codec, int samplerate, int mixdown, in break; case HB_ACODEC_CA_AAC: - *low = channels * 80; + *low = channels * 40; if (samplerate <= 44100) - *low = channels * 64; - if (samplerate <= 24000) *low = channels * 32; + if (samplerate <= 24000) + *low = channels * 16; *high = hb_audio_bitrates[hb_audio_bitrates_count-1].rate; break; |