Unverified Commit ce87ee9b authored by Wolle's avatar Wolle Committed by GitHub

Audio File Duration Limit #289

parent 386e108d
......@@ -3884,10 +3884,10 @@ uint32_t Audio::getAudioFileDuration() {
if(m_f_localfile) {if(!audiofile) return 0;}
if(m_f_webfile) {if(!m_contentlength) return 0;}
if (m_avr_bitrate && m_codec == CODEC_MP3) m_audioFileDuration = 8 * m_audioDataSize / m_avr_bitrate;
else if(m_avr_bitrate && m_codec == CODEC_WAV) m_audioFileDuration = 8 * m_audioDataSize / m_avr_bitrate;
else if(m_avr_bitrate && m_codec == CODEC_M4A) m_audioFileDuration = 8 * m_audioDataSize / m_avr_bitrate;
else if(m_avr_bitrate && m_codec == CODEC_AAC) m_audioFileDuration = 8 * m_audioDataSize / m_avr_bitrate;
if (m_avr_bitrate && m_codec == CODEC_MP3) m_audioFileDuration = 8 * (m_audioDataSize / m_avr_bitrate); // #289
else if(m_avr_bitrate && m_codec == CODEC_WAV) m_audioFileDuration = 8 * (m_audioDataSize / m_avr_bitrate);
else if(m_avr_bitrate && m_codec == CODEC_M4A) m_audioFileDuration = 8 * (m_audioDataSize / m_avr_bitrate);
else if(m_avr_bitrate && m_codec == CODEC_AAC) m_audioFileDuration = 8 * (m_audioDataSize / m_avr_bitrate);
else if( m_codec == CODEC_FLAC) m_audioFileDuration = FLACGetAudioFileDuration();
else return 0;
return m_audioFileDuration;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment