Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

master: "error: 'AAC_PCM_OUTPUT_CHANNELS' undeclared" #3

Closed
infirit opened this issue Oct 16, 2016 · 1 comment
Closed

master: "error: 'AAC_PCM_OUTPUT_CHANNELS' undeclared" #3

infirit opened this issue Oct 16, 2016 · 1 comment

Comments

@infirit
Copy link

infirit commented Oct 16, 2016

This happens for me with version 0.1.4. With a bit of googling this seems to have been some changes in fdk-aac. At the bottom a probably incomplete diff but this made it compile for me.

gcc -DHAVE_CONFIG_H -I. -I..  -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include    -g -O2 -MT io.o -MD -MP -MF .deps/io.Tpo -c -o io.o io.c
io.c: In function 'io_thread_a2dp_sbc_forward':
io.c:256:2: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
  pthread_cleanup_push(io_thread_release_bt, t);
  ^
io.c:287:2: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
  pthread_cleanup_push(sbc_finish, &sbc);
  ^
io.c: In function 'io_thread_a2dp_sbc_backward':
io.c:390:2: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
  pthread_cleanup_push(io_thread_release_bt, t);
  ^
io.c:417:2: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
  pthread_cleanup_push(sbc_finish, &sbc);
  ^
io.c: In function 'io_thread_a2dp_aac_forward':
io.c:567:2: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
  pthread_cleanup_push(io_thread_release_bt, t);
  ^
io.c:586:2: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
  pthread_cleanup_push(aacDecoder_Close, handle);
  ^
io.c:589:41: error: 'AAC_PCM_OUTPUT_CHANNELS' undeclared (first use in this function)
  if ((err = aacDecoder_SetParam(handle, AAC_PCM_OUTPUT_CHANNELS, channels)) != AAC_DEC_OK) {
                                         ^
io.c:589:41: note: each undeclared identifier is reported only once for each function it appears in
io.c: In function 'io_thread_a2dp_aac_backward':
io.c:683:2: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
  pthread_cleanup_push(io_thread_release_bt, t);
  ^
io.c:696:2: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
  pthread_cleanup_push(aacEncClose, &handle);
  ^
make[3]: *** [Makefile:488: io.o] Error 1
make[3]: Leaving directory '/home/sander/repos/bluez-alsa/src'
make[2]: *** [Makefile:521: all-recursive] Error 1
make[2]: Leaving directory '/home/sander/repos/bluez-alsa/src'
make[1]: *** [Makefile:415: all-recursive] Error 1
make[1]: Leaving directory '/home/sander/repos/bluez-alsa'
make: *** [Makefile:347: all] Error 2
diff --git a/src/io.c b/src/io.c
index 93edbbf..10b98c5 100644
--- a/src/io.c
+++ b/src/io.c
@@ -25,6 +25,9 @@
 #if ENABLE_AAC
 # include <fdk-aac/aacdecoder_lib.h>
 # include <fdk-aac/aacenc_lib.h>
+# ifndef AACDECODER_LIB_VL0
+#  define AAC_PCM_MAX_OUTPUT_CHANNELS AAC_PCM_OUTPUT_CHANNELS
+# endif
 #endif

 #include "a2dp-codecs.h"
@@ -581,7 +584,7 @@ void *io_thread_a2dp_aac_forward(void *arg) {
    pthread_cleanup_push(aacDecoder_Close, handle);

    const unsigned int channels = transport_get_channels(t);
-   if ((err = aacDecoder_SetParam(handle, AAC_PCM_OUTPUT_CHANNELS, channels)) != AAC_DEC_OK) {
+   if ((err = aacDecoder_SetParam(handle, AAC_PCM_MAX_OUTPUT_CHANNELS, channels)) != AAC_DEC_OK) {
        error("Couldn't set output channels: %s", aacdec_strerror(err));
        goto fail_init;
    }
@arkq arkq closed this as completed in 0010fc5 Oct 16, 2016
@arkq
Copy link
Owner

arkq commented Oct 16, 2016

Many thanks for testing with fdk-aac-0.1.4. I thought, that this release is only a bug fix release, however is seems, that the correct version number should be 1.4.0 - there are new features introduced. But, there is also an API breakdown...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants