Commit ad7e0654 authored by Thomas Eschenbacher's avatar Thomas Eschenbacher
Browse files

bugfix: wrong calculation on opus encoder, causing corrupted files

parent 5570502c
......@@ -5,6 +5,7 @@
misinterpreting file names in cmdline parameters as http:// URLs
* fixed deprecation warnings: QRecursiveMutex, KPluginFactory
* bugfix: wrong tooltip translation for selection range (and other times)
* bugfix: wrong calculation on opus encoder, causing corrupted files
20.08.01 [2020-08-31]
......
......@@ -1417,7 +1417,7 @@ void Kwave::TopWidget::updateMenu()
foreach (const Kwave::Label &label, labels) {
QString name = label.name();
QString desc = (name.length()) ?
i18nc(
i18nc(
"list menu entry of a label, %1=index, %2=description/name",
"#%1 (%2)", index, name) :
i18nc("list menue entry of a label, "
......
......@@ -786,7 +786,6 @@ unsigned int Kwave::OpusEncoder::fillInBuffer(Kwave::MultiTrackReader &src)
unsigned int count = 0;
unsigned int rest = m_frame_size;
while (rest) {
float *p = m_encoder_input + t;
// while buffer is empty and source is not at eof:
// trigger the start of the chain to produce some data
......@@ -805,6 +804,7 @@ unsigned int Kwave::OpusEncoder::fillInBuffer(Kwave::MultiTrackReader &src)
// fill the frame data
rest -= len;
count += len;
float *p = m_encoder_input + t;
while (len--) {
*p = sample2float(*(s++));
p += m_encoder_channels;
......@@ -818,12 +818,13 @@ unsigned int Kwave::OpusEncoder::fillInBuffer(Kwave::MultiTrackReader &src)
// if we were not able to fill a complete frame, we probably are at eof
// and have some space to pad with extra samples to compensate preskip
while ((n < m_frame_size) && m_extra_out) {
unsigned int extra_out = m_extra_out;
while ((n < m_frame_size) && extra_out) {
Q_ASSERT(src.eof());
for (unsigned int t = 0; t < m_encoder_channels; ++t) {
m_encoder_input[(n + t) * m_encoder_channels] = 0.0;
m_encoder_input[(n * m_encoder_channels) + t] = 0.0;
}
m_extra_out--;
extra_out--;
n++;
}
......
Supports Markdown
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