towards fixing #5711
Don’t call ::output() [here: SilenceTrimmer::process()] with no data to process. If (position + N * period-size) % chunksize == 0; frames_left == 0 before the last call to ::output(). chunker.h:60 keeps the ProcessContext<T>::EndOfInput flag and the SilenceTrimmer will already have done ‘in_end’ processing.
This commit is contained in:
@@ -67,7 +67,7 @@ class /*LIBAUDIOGRAPHER_API*/ Chunker
|
||||
position += frames_left;
|
||||
}
|
||||
|
||||
if (context.has_flag (ProcessContext<T>::EndOfInput)) {
|
||||
if (context.has_flag (ProcessContext<T>::EndOfInput) && position > 0) {
|
||||
ProcessContext<T> c_out (context, buffer, position);
|
||||
ListedSource<T>::output (c_out);
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ class /*LIBAUDIOGRAPHER_API*/ SilenceTrimmer
|
||||
check_flags (*this, c);
|
||||
|
||||
if (throw_level (ThrowStrict) && in_end) {
|
||||
throw Exception(*this, "process() after reacing end of input");
|
||||
throw Exception(*this, "process() after reaching end of input");
|
||||
}
|
||||
in_end = c.has_flag (ProcessContext<T>::EndOfInput);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user