summaryrefslogtreecommitdiff
path: root/libs/audiographer
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-01-27 23:13:29 +0100
committerRobin Gareus <robin@gareus.org>2015-01-27 23:13:55 +0100
commit36bbd14113e25038aa490d11c7c010fcaae324a0 (patch)
tree0bc51d3392fa1e97aaeb1e75668241bdf174fd03 /libs/audiographer
parent6377fe89a696973ec6ccc919f842503b481ab105 (diff)
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.
Diffstat (limited to 'libs/audiographer')
-rw-r--r--libs/audiographer/audiographer/general/chunker.h2
-rw-r--r--libs/audiographer/audiographer/general/silence_trimmer.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/libs/audiographer/audiographer/general/chunker.h b/libs/audiographer/audiographer/general/chunker.h
index 0ee0c20b20..d61c68dee4 100644
--- a/libs/audiographer/audiographer/general/chunker.h
+++ b/libs/audiographer/audiographer/general/chunker.h
@@ -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);
}
diff --git a/libs/audiographer/audiographer/general/silence_trimmer.h b/libs/audiographer/audiographer/general/silence_trimmer.h
index c0d6d73c4b..a715feb0c8 100644
--- a/libs/audiographer/audiographer/general/silence_trimmer.h
+++ b/libs/audiographer/audiographer/general/silence_trimmer.h
@@ -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);