From 1550f1ef007f58bab1b529d9b9a4a820cf8e9fa6 Mon Sep 17 00:00:00 2001 From: Sakari Bergen Date: Sun, 3 Feb 2013 14:51:08 +0000 Subject: [PATCH] Work around a bug in gdither with 32-bit integer export, fixes 32-bit export. git-svn-id: svn://localhost/ardour2/branches/3.0@14047 d708f5d6-7413-0410-9779-e7cbd77b26cf --- .../src/general/sample_format_converter.cc | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/libs/audiographer/src/general/sample_format_converter.cc b/libs/audiographer/src/general/sample_format_converter.cc index 5a48d496d7..9aa215db69 100644 --- a/libs/audiographer/src/general/sample_format_converter.cc +++ b/libs/audiographer/src/general/sample_format_converter.cc @@ -57,16 +57,12 @@ SampleFormatConverter::init (framecnt_t max_frames, int type, int data_ if(throw_level (ThrowObject) && data_width < 24) { throw Exception (*this, "Trying to use SampleFormatConverter for data widths < 24"); } - + init_common (max_frames); - - if (data_width == 24) { - dither = gdither_new ((GDitherType) type, channels, GDither32bit, data_width); - } else if (data_width == 32) { - dither = gdither_new (GDitherNone, channels, GDitherFloat, data_width); - } else if (throw_level (ThrowObject)) { - throw Exception (*this, "Unsupported data width"); - } + + // 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); } template <>