GNOME Bugzilla – Bug 585828
audioamplify should support more formats
Last modified: 2009-06-22 16:11:47 UTC
The audioamplify element should support more formats.
Created attachment 136613 [details] [review] Adds support for double precision floats This patch adds support for double precision floats, but this is maybe going down the wrong path. The adder has what might be considered a cleaner approach to constructing lots of functions for supporting different formats. It uses a preprocessor macro to generate variations of the required functions.
Yes, at least the float/double processing functions could be handled by a simple preprocessor macro. Do you want to prepare a patch?
Sure. I'll re-work it to use macros.
Created attachment 136985 [details] [review] adds support for more formats and clipping methods This patch adds support for double precision floats, 8- and 32-bit signed integers and also adds a "no clipping" clipping mode (e.g., for use with float samples). A macro system is used, inspired by adder's.
commit afccf53acee778b057f4f4bae19a41397fe8ff36 Author: Kipp Cannon <kcannon@ligo.caltech.edu> Date: Fri Jun 19 22:20:45 2009 +0200 audioamplify: Add noclip method and support for more formats Fixes bug #585828 and #585831.
Created attachment 137092 [details] [review] don't declare a loop index static The previous patch to add support for additional sample formats possibly introduced a reentrancy bug: a variable used for a loop index was declared static. This patch fixes that, and also adds a "/* *INDENT-ON* */" annotation following the macro block. (I don't know what the annotation is for, but the adder, where I copied this from, has it).
ommit f80b62c3db332992e110589e8b5dfe732ff5ed46 Author: Kipp Cannon <kcannon@ligo.caltech.edu> Date: Sun Jun 21 09:50:54 2009 +0200 audioamplify: Don't declare a loop index static The previous patch to add support for additional sample formats possibly introduced a reentrancy bug: a variable used for a loop index was declared static. This patch fixes that, and also adds a "/* *INDENT-ON* */" annotation following the macro block. (I don't know what the annotation is for, but the adder, where I copied this from, has it).
The INDENT-ON directive does nothing without a preceding INDENT-OFF directive somewhere. Without that, it's just unnecessary noise. It's an instruction to GNU indent not to mess with the formatting of the section between the two directives.