summaryrefslogtreecommitdiffstats
path: root/ext/wavpack
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.net>2007-12-09 16:34:08 +0000
committerTim-Philipp Müller <tim@centricular.net>2007-12-09 16:34:08 +0000
commit8e51b9930b83ad35fbbda6482b7d637cc543f9be (patch)
tree4ec6f0c1eaa5523e3b13767404b6647c78b9a97e /ext/wavpack
parent857bc80049446c4a93cbcc65c509bee6906db514 (diff)
ext/wavpack/gstwavpackdec.c: More build fixes for old libwavpack versions: include config.h so that WAVPACK_OLD_API i...
Original commit message from CVS: * ext/wavpack/gstwavpackdec.c: More build fixes for old libwavpack versions: include config.h so that WAVPACK_OLD_API is actually defined as detected; only use WavpackGetErrorMessage if it is available. This fixes the build on debian stable for me.
Diffstat (limited to 'ext/wavpack')
-rw-r--r--ext/wavpack/gstwavpackdec.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/ext/wavpack/gstwavpackdec.c b/ext/wavpack/gstwavpackdec.c
index b8191258..488d2716 100644
--- a/ext/wavpack/gstwavpackdec.c
+++ b/ext/wavpack/gstwavpackdec.c
@@ -40,6 +40,10 @@
* </refsect2>
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <gst/gst.h>
#include <gst/audio/audio.h>
#include <gst/audio/multichannel.h>
@@ -410,10 +414,17 @@ invalid_header:
}
decode_error:
{
+ const gchar *reason = "unknown";
+
+ if (dec->context) {
+#ifndef WAVPACK_OLD_API
+ reason = WavpackGetErrorMessage (dec->context);
+#endif
+ } else {
+ reason = "couldn't create decoder context";
+ }
GST_ELEMENT_ERROR (dec, STREAM, DECODE, (NULL),
- ("Failed to decode wavpack stream: %s",
- (dec->context) ? WavpackGetErrorMessage (dec->
- context) : "couldn't create decoder context"));
+ ("Failed to decode wavpack stream: %s", reason));
gst_buffer_unref (outbuf);
gst_buffer_unref (buf);
return GST_FLOW_ERROR;