Commit e765addd authored by Michael Smith's avatar Michael Smith
Browse files

Fix compile on systems with broken faad headers.

Original commit message from CVS:
Fix compile on systems with broken faad headers.
parent 6b94a533
2005-11-11 Michael Smith <msmith@fluendo.com>
* ext/faad/gstfaad.c: (gst_faad_setcaps), (gst_faad_chain):
Make this compile on systems with broken headers.
2005-11-11 Michael Smith <msmith@fluendo.com> 2005-11-11 Michael Smith <msmith@fluendo.com>
* ext/faad/gstfaad.c: (gst_faad_setcaps), (gst_faad_chain): * ext/faad/gstfaad.c: (gst_faad_setcaps), (gst_faad_chain):
......
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
#include <gst/audio/audio.h> #include <gst/audio/audio.h>
#include <gst/audio/multichannel.h> #include <gst/audio/multichannel.h>
/* These are the correct types for these functions, as defined in the source. /* These are the correct types for these functions, as defined in the source,
* with types changed to match glib types, since those are defined for us.
* However, upstream FAAD is distributed with a broken header file that defined * However, upstream FAAD is distributed with a broken header file that defined
* these wrongly (in a way which was broken on 64 bit systems). * these wrongly (in a way which was broken on 64 bit systems).
* Upstream CVS still has the bug, but has also renamed all the public symbols * Upstream CVS still has the bug, but has also renamed all the public symbols
...@@ -36,16 +37,15 @@ ...@@ -36,16 +37,15 @@
* but not all, hence this Truly Evil Hack. This hack will need updating if * but not all, hence this Truly Evil Hack. This hack will need updating if
* upstream ever releases something with the new API. * upstream ever releases something with the new API.
*/ */
#define faadDecInit faadDecInit_no_definition #define faacDecInit faadDecInit_no_definition
#define faadDecInit2 faadDecInit2_no_definition #define faacDecInit2 faadDecInit2_no_definition
#include "gstfaad.h" #include "gstfaad.h"
#undef faadDecInit #undef faacDecInit
#undef faadDecInit2 #undef faacDecInit2
extern long faadDecInit (faacDecHandle, uint8_t *, uint32_t, extern long faacDecInit (faacDecHandle, guint8 *, guint32, guint32 *, guint8 *);
uint32_t *, uint8_t *); extern int8_t faacDecInit2 (faacDecHandle, guint8 *, guint32,
extern int8_t faadDecInit2 (faacDecHandle, uint8_t *, uint32_t, guint32 *, guint8 *);
uint32_t *, uint8_t *);
GST_DEBUG_CATEGORY_STATIC (faad_debug); GST_DEBUG_CATEGORY_STATIC (faad_debug);
#define GST_CAT_DEFAULT faad_debug #define GST_CAT_DEFAULT faad_debug
...@@ -227,7 +227,7 @@ gst_faad_setcaps (GstPad * pad, GstCaps * caps) ...@@ -227,7 +227,7 @@ gst_faad_setcaps (GstPad * pad, GstCaps * caps)
buf = GST_BUFFER (gst_value_get_mini_object (value)); buf = GST_BUFFER (gst_value_get_mini_object (value));
/* someone forgot that char can be unsigned when writing the API */ /* someone forgot that char can be unsigned when writing the API */
if ((gint8) faadDecInit2 (faad->handle, if ((gint8) faacDecInit2 (faad->handle,
GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf), &samplerate, GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf), &samplerate,
&channels) < 0) { &channels) < 0) {
GST_DEBUG ("faacDecInit2() failed"); GST_DEBUG ("faacDecInit2() failed");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment