Ticket #50784: configure.coreaudio.patch

File configure.coreaudio.patch, 1.7 KB (added by noel@…, 8 years ago)

patch updating API calls

  • libao2/ao_coreaudio.c

    old new  
    412412static int init(int rate,int channels,int format,int flags)
    413413{
    414414AudioStreamBasicDescription inDesc;
    415 ComponentDescription desc;
    416 Component comp;
     415AudioComponentDescription desc;
     416AudioComponent comp;
    417417AURenderCallbackStruct renderCallback;
    418418OSStatus err;
    419419UInt32 size, maxFrames, b_alive;
     
    557557        desc.componentFlags = 0;
    558558        desc.componentFlagsMask = 0;
    559559
    560         comp = FindNextComponent(NULL, &desc);  //Finds an component that meets the desc spec's
     560        comp = AudioComponentFindNext(NULL, &desc);  //Finds an component that meets the desc spec's
    561561        if (comp == NULL) {
    562562                ao_msg(MSGT_AO, MSGL_WARN, "Unable to find Output Unit component\n");
    563563                goto err_out;
    564564        }
    565565
    566         err = OpenAComponent(comp, &(ao->theOutputUnit));  //gains access to the services provided by the component
     566        err = AudioComponentInstanceNew(comp, &(ao->theOutputUnit));  //gains access to the services provided by the component
    567567        if (err) {
    568568                ao_msg(MSGT_AO, MSGL_WARN, "Unable to open Output Unit component: [%4.4s]\n", (char *)&err);
    569569                goto err_out;
     
    625625err_out2:
    626626    AudioUnitUninitialize(ao->theOutputUnit);
    627627err_out1:
    628     CloseComponent(ao->theOutputUnit);
     628    AudioComponentInstanceDispose(ao->theOutputUnit);
    629629err_out:
    630630    av_fifo_free(ao->buffer);
    631631    free(ao);
     
    11411141  if (!ao->b_digital) {
    11421142      AudioOutputUnitStop(ao->theOutputUnit);
    11431143      AudioUnitUninitialize(ao->theOutputUnit);
    1144       CloseComponent(ao->theOutputUnit);
     1144      AudioComponentInstanceDispose(ao->theOutputUnit);
    11451145  }
    11461146  else {
    11471147      /* Stop device. */