summaryrefslogtreecommitdiff
path: root/libs/audiographer
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-12-03 11:51:25 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2013-12-03 11:51:25 -0500
commit8648a8a13b04549362f14a0738947d997ef1abc7 (patch)
tree702652b49789b13d647c4c93df985f65361a4118 /libs/audiographer
parentc428ec14b923928690492cab0428f8fad45f7658 (diff)
parentae6b0b9f1ab02ab949eaf741b98e69bdab487e92 (diff)
fix up wscript/build issues in exportvis after merge with master
Diffstat (limited to 'libs/audiographer')
-rw-r--r--libs/audiographer/audiographer/general/silence_trimmer.h6
-rw-r--r--libs/audiographer/src/general/sample_format_converter.cc25
2 files changed, 18 insertions, 13 deletions
diff --git a/libs/audiographer/audiographer/general/silence_trimmer.h b/libs/audiographer/audiographer/general/silence_trimmer.h
index 8a8dd920f5..4cb9f9a5d9 100644
--- a/libs/audiographer/audiographer/general/silence_trimmer.h
+++ b/libs/audiographer/audiographer/general/silence_trimmer.h
@@ -131,6 +131,9 @@ class LIBAUDIOGRAPHER_API SilenceTrimmer
throw Exception(*this, "process() after reacing end of input");
}
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;
@@ -209,7 +212,8 @@ class LIBAUDIOGRAPHER_API SilenceTrimmer
// Finally, if in end, add silence to end
if (in_end && add_to_end) {
-
+ c.set_flag (ProcessContext<T>::EndOfInput);
+
if (debug_level (DebugVerbose)) {
debug_stream () << DebugUtils::demangled_name (*this) <<
" adding to end" << std::endl;
diff --git a/libs/audiographer/src/general/sample_format_converter.cc b/libs/audiographer/src/general/sample_format_converter.cc
index ea70dc6094..5fe9a1185b 100644
--- a/libs/audiographer/src/general/sample_format_converter.cc
+++ b/libs/audiographer/src/general/sample_format_converter.cc
@@ -52,25 +52,24 @@ SampleFormatConverter<float>::init (framecnt_t max_frames, int /* type */, int d
template <>
void
-SampleFormatConverter<int32_t>::init (framecnt_t max_frames, int /*type*/, int data_width)
+SampleFormatConverter<int32_t>::init (framecnt_t max_frames, int type, int data_width)
{
- if(throw_level (ThrowObject) && data_width < 24) {
- throw Exception (*this, "Trying to use SampleFormatConverter<int32_t> for data widths < 24");
+ // GDither is broken with GDither32bit if the dither depth is bigger than 24
+ if(throw_level (ThrowObject) && data_width > 24) {
+ throw Exception (*this, "Trying to use SampleFormatConverter<int32_t> a data width > 24");
}
-
init_common (max_frames);
-
- // GDither is broken with GDither32bit if the dither depth
- // is bigger than 24, so lets just use that...
- dither = gdither_new (GDitherNone, channels, GDither32bit, 24);
+ dither = gdither_new ((GDitherType) type, channels, GDither32bit, data_width);
}
template <>
void
SampleFormatConverter<int16_t>::init (framecnt_t max_frames, int type, int data_width)
{
- if (throw_level (ThrowObject) && data_width != 16) {
- throw Exception (*this, "Unsupported data width");
+ if (throw_level (ThrowObject) && data_width > 16) {
+ throw Exception (*this, boost::str(boost::format
+ ("Data width (%1) too large for int16_t")
+ % data_width));
}
init_common (max_frames);
dither = gdither_new ((GDitherType) type, channels, GDither16bit, data_width);
@@ -80,8 +79,10 @@ template <>
void
SampleFormatConverter<uint8_t>::init (framecnt_t max_frames, int type, int data_width)
{
- if (throw_level (ThrowObject) && data_width != 8) {
- throw Exception (*this, "Unsupported data width");
+ if (throw_level (ThrowObject) && data_width > 8) {
+ throw Exception (*this, boost::str(boost::format
+ ("Data width (%1) too large for uint8_t")
+ % data_width));
}
init_common (max_frames);
dither = gdither_new ((GDitherType) type, channels, GDither8bit, data_width);