Address deprecated call warnings in CoreAudio driver

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
master
Claudio Matsuoka 12 years ago
parent 2bb8e71264
commit 8058998e1a
  1. 3
      Changelog
  2. 2
      configure.ac
  3. 18
      src/sound_coreaudio.c

@ -1,6 +1,9 @@
Stable versions
---------------
4.0.10 ():
- Update deprecated calls in CoreAudio driver
4.0.9 (20140926):
- Add option '-p' to set the default pan amplitude
- Add parameter 'default_pan' to configuration file

@ -137,7 +137,7 @@ amigaos*|aros)
AM_CONDITIONAL([SOUND_AHI], [true])
;;
darwin*)
AC_CHECK_HEADER(CoreAudio/CoreAudio.h)
AC_CHECK_HEADERS(AudioUnit/AudioComponent.h CoreAudio/CoreAudio.h)
if test "${ac_cv_header_CoreAudio_CoreAudio_h}" = "yes"; then
AC_DEFINE(SOUND_COREAUDIO)
AM_CONDITIONAL([SOUND_COREAUDIO], [true])

@ -15,6 +15,14 @@
static AudioUnit au;
#ifndef HAVE_AUDIOUNIT_AUDIOCOMPONENT_H
#define AudioComponent Component
#define AudioComponentDescription ComponentDescription
#define AudioComponentFindNext FindNextComponent
#define AudioComponentInstanceNew OpenAComponent
#define AudioComponentInstanceDispose CloseComponent
#endif
/*
* CoreAudio helpers by Timothy J. Wood from mplayer/libao
* The player fills a ring buffer, OSX retrieves data from the buffer
@ -121,8 +129,8 @@ OSStatus render_proc(void *inRefCon,
static int init(struct options *options)
{
AudioStreamBasicDescription ad;
Component comp;
ComponentDescription cd;
AudioComponent comp;
AudioComponentDescription cd;
AURenderCallbackStruct rc;
OSStatus err;
UInt32 size, max_frames;
@ -160,12 +168,12 @@ static int init(struct options *options)
cd.componentFlags = 0;
cd.componentFlagsMask = 0;
if ((comp = FindNextComponent(NULL, &cd)) == NULL) {
if ((comp = AudioComponentFindNext(NULL, &cd)) == NULL) {
fprintf(stderr, "error: FindNextComponent\n");
return -1;
}
if ((err = OpenAComponent(comp, &au))) {
if ((err = AudioComponentInstanceNew(comp, &au))) {
fprintf(stderr, "error: OpenAComponent (%d)\n", (int)err);
return -1;
}
@ -250,7 +258,7 @@ static void deinit(void)
{
AudioOutputUnitStop(au);
AudioUnitUninitialize(au);
CloseComponent(au);
AudioComponentInstanceDispose(au);
free(buffer);
}

Loading…
Cancel
Save