From 9c4e97a61b59105c9b539faca272305bbb234c17 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 16 Nov 2008 20:04:49 +0100 Subject: aac: detect whether to pass "uint32_t*" to NeAACDecInit2() neaacdec.h declares all arguments as "unsigned long", but internally expects uint32_t pointers. This triggers gcc warnings on 64 bit architectures. To avoid that, make configure.ac detect whether we're using Debian's corrected headers or the original libfaad headers. In any case, pass a pointer to an uint32_t, conditionally casted to "unsigned long*". --- src/decoder/mp4_plugin.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/decoder/mp4_plugin.c') diff --git a/src/decoder/mp4_plugin.c b/src/decoder/mp4_plugin.c index 2736d3059..f97ffe50a 100644 --- a/src/decoder/mp4_plugin.c +++ b/src/decoder/mp4_plugin.c @@ -112,6 +112,14 @@ mp4_decode(struct decoder *mpd_decoder, struct input_stream *input_stream) unsigned char *mp4_buffer; unsigned int mp4_buffer_size; uint32_t sample_rate; +#ifdef HAVE_FAAD_LONG + /* neaacdec.h declares all arguments as "unsigned long", but + internally expects uint32_t pointers. To avoid gcc + warnings, use this workaround. */ + unsigned long *sample_rate_r = (unsigned long*)&sample_rate; +#else + uint32_t *sample_rate_r = &sample_rate; +#endif unsigned char channels; long sample_id; long num_samples; @@ -160,7 +168,7 @@ mp4_decode(struct decoder *mpd_decoder, struct input_stream *input_stream) mp4ff_get_decoder_config(mp4fh, track, &mp4_buffer, &mp4_buffer_size); if (faacDecInit2(decoder, mp4_buffer, mp4_buffer_size, - &sample_rate, &channels) < 0) { + sample_rate_r, &channels) < 0) { g_warning("Not an AAC stream.\n"); faacDecClose(decoder); mp4ff_close(mp4fh); -- cgit v1.2.3