fixed calculation of duration of MPEG 1/2 audio streams
This commit is contained in:
parent
5490552e3b
commit
e9a204777d
|
@ -58,8 +58,7 @@ void MpegAudioFrameStream::internalParseHeader()
|
|||
m_bitrate = frame.isXingFramefieldPresent()
|
||||
? ((static_cast<double>(m_size) * 8.0) / (static_cast<double>(frame.xingFrameCount() * frame.sampleCount()) / static_cast<double>(frame.samplingFrequency())) / 1024.0)
|
||||
: frame.bitrate();
|
||||
m_bytesPerSecond = m_bitrate * 125;
|
||||
m_duration = TimeSpan::fromSeconds(static_cast<double>(m_size) / (m_bitrate * 128.0));
|
||||
m_duration = TimeSpan::fromSeconds(static_cast<double>(m_size) / (m_bytesPerSecond = m_bitrate * 125));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue