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:
Robin Gareus 2015-01-27 23:13:29 +01:00
parent 6377fe89a6
commit 36bbd14113
2 changed files with 2 additions and 2 deletions

View file

@ -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);
}

View file

@ -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);