Version 1.0.0 of the libao library added a new field to the
ao_sample_format struct.  It is a char * named matrix.  When
an ao_sample_format is allocated on the stack, this field contains
garbage.  The proper course is to insure that is initialized to NULL.
NULL indicates that we do not want any mapping.
The struct is now initialized using a static initializer, and this
technique is compatible with all known versions of libao.
---
 src/output/ao_plugin.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/output/ao_plugin.c b/src/output/ao_plugin.c
index 21d60eb..0c6731e 100644
--- a/src/output/ao_plugin.c
+++ b/src/output/ao_plugin.c
@@ -26,6 +26,9 @@
 #undef G_LOG_DOMAIN
 #define G_LOG_DOMAIN "ao"
 
+/* An ao_sample_format, with all fields set to zero: */
+static const ao_sample_format  OUR_AO_FORMAT_INITIALIZER;
+
 static unsigned ao_output_ref;
 
 struct ao_data {
@@ -167,7 +170,7 @@ static bool
 ao_output_open(void *data, struct audio_format *audio_format,
               GError **error)
 {
-       ao_sample_format format;
+       ao_sample_format format = OUR_AO_FORMAT_INITIALIZER;
        struct ao_data *ad = (struct ao_data *)data;
 
        switch (audio_format->format) {
-- 
1.7.3.4


------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team

Reply via email to