13
0

Fix invalid silence trimmer end-of-input behavior (multiple EndOfInputs)

This caused an export bug when:
a) normalizing
b) adding silence to end
c) having more than one channel

The sound was corrupted by repeating each jack frame as many times
as there were channels.
This commit is contained in:
Sakari Bergen 2013-11-03 21:22:00 +02:00
parent f2300164d7
commit 3fca030603

View File

@ -130,6 +130,9 @@ class SilenceTrimmer
throw Exception(*this, "process() after reacing end of input"); throw Exception(*this, "process() after reacing end of input");
} }
in_end = c.has_flag (ProcessContext<T>::EndOfInput); in_end = c.has_flag (ProcessContext<T>::EndOfInput);
// If adding to end, delay end of input propagation
if (add_to_end) { c.remove_flag(ProcessContext<T>::EndOfInput); }
framecnt_t frame_index = 0; framecnt_t frame_index = 0;
@ -208,7 +211,8 @@ class SilenceTrimmer
// Finally, if in end, add silence to end // Finally, if in end, add silence to end
if (in_end && add_to_end) { if (in_end && add_to_end) {
c.set_flag (ProcessContext<T>::EndOfInput);
if (debug_level (DebugVerbose)) { if (debug_level (DebugVerbose)) {
debug_stream () << DebugUtils::demangled_name (*this) << debug_stream () << DebugUtils::demangled_name (*this) <<
" adding to end" << std::endl; " adding to end" << std::endl;