diff options
author | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-10-03 22:23:26 +0000 |
---|---|---|
committer | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-10-03 22:23:26 +0000 |
commit | e24087509a752d8f4dcc679b304fc1745ff768b0 (patch) | |
tree | 60bbaca1e13f268df83d5d88c1daa49debacc541 /libfaad2/mp4.c | |
parent | 22c9bcf82417c33258c74104704f196f6672f696 (diff) | |
download | mpv-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/mp4.c')
-rw-r--r-- | libfaad2/mp4.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/libfaad2/mp4.c b/libfaad2/mp4.c index f04733e1be..ef8ecf0c5a 100644 --- a/libfaad2/mp4.c +++ b/libfaad2/mp4.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: mp4.c,v 1.17 2003/07/29 08:20:12 menno Exp $ +** $Id: mp4.c,v 1.19 2003/09/18 13:38:38 menno Exp $ **/ #include "common.h" @@ -148,7 +148,7 @@ int8_t FAADAPI AudioSpecificConfig2(uint8_t *pBuffer, mp4ASC->channelsConfiguration = (uint8_t)faad_getbits(&ld, 4 DEBUGVAR(1,3,"parse_audio_decoder_specific_info(): ChannelsConfiguration")); - mp4ASC->samplingFrequency = sample_rates[mp4ASC->samplingFrequencyIndex]; + mp4ASC->samplingFrequency = get_sample_rate(mp4ASC->samplingFrequencyIndex); if (ObjectTypesTable[mp4ASC->objectTypeIndex] != 1) { @@ -180,7 +180,7 @@ int8_t FAADAPI AudioSpecificConfig2(uint8_t *pBuffer, mp4ASC->samplingFrequency = (uint32_t)faad_getbits(&ld, 24 DEBUGVAR(1,6,"parse_audio_decoder_specific_info(): extensionSamplingFrequencyIndex")); } else { - mp4ASC->samplingFrequency = sample_rates[mp4ASC->samplingFrequencyIndex]; + mp4ASC->samplingFrequency = get_sample_rate(mp4ASC->samplingFrequencyIndex); } mp4ASC->objectTypeIndex = (uint8_t)faad_getbits(&ld, 5 DEBUGVAR(1,7,"parse_audio_decoder_specific_info(): ObjectTypeIndex")); @@ -216,7 +216,7 @@ int8_t FAADAPI AudioSpecificConfig2(uint8_t *pBuffer, #ifdef SBR_DEC - bits_to_decode = buffer_size*8 - faad_get_processed_bits(&ld); + bits_to_decode = (int8_t)(buffer_size*8 - faad_get_processed_bits(&ld)); if ((mp4ASC->objectTypeIndex != 5) && (bits_to_decode >= 16)) { @@ -242,12 +242,23 @@ int8_t FAADAPI AudioSpecificConfig2(uint8_t *pBuffer, mp4ASC->samplingFrequency = (uint32_t)faad_getbits(&ld, 24 DEBUGVAR(1,13,"parse_audio_decoder_specific_info(): extensionSamplingFrequencyIndex")); } else { - mp4ASC->samplingFrequency = sample_rates[mp4ASC->samplingFrequencyIndex]; + mp4ASC->samplingFrequency = get_sample_rate(mp4ASC->samplingFrequencyIndex); } } } } } + + /* no SBR signalled, this could mean either implicit signalling or no SBR in this file */ + /* MPEG specification states: assume SBR on files with samplerate <= 24000 Hz */ + if (mp4ASC->sbr_present_flag == -1) + { + if (mp4ASC->samplingFrequency <= 24000) + { + mp4ASC->samplingFrequency *= 2; + mp4ASC->forceUpSampling = 1; + } + } #endif faad_endbits(&ld); |