VirtualBox

Changeset 59429 in vbox


Ignore:
Timestamp:
Jan 21, 2016 3:09:17 PM (9 years ago)
Author:
vboxsync
Message:

Audio/DrvHostCoreAudio.cpp: Another try to get recording to work on older OS X versions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DrvHostCoreAudio.cpp

    r59428 r59429  
    898898            LogRel(("CoreAudio: Failed to set input audio converter quality to the maximum (%RI32)\n", err));
    899899#endif
    900     }
    901 
    902 
    903     /* Set the new output format description for the input stream. */
    904     err = AudioUnitSetProperty(pStreamIn->audioUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output,
    905                                1, &pStreamIn->streamFormat, sizeof(pStreamIn->streamFormat));
    906     if (err != noErr)
    907     {
    908         LogRel(("CoreAudio: Failed to set output format for input stream (%RI32)\n", err));
    909         return VERR_AUDIO_BACKEND_INIT_FAILED; /** @todo Fudge! */
     900
     901        /* Set the new format description for the stream. */
     902        err = AudioUnitSetProperty(pStreamIn->audioUnit,
     903                                   kAudioUnitProperty_StreamFormat,
     904                                   kAudioUnitScope_Output,
     905                                   1,
     906                                   &pStreamIn->deviceFormat,
     907                                   sizeof(pStreamIn->deviceFormat));
     908        if (RT_UNLIKELY(err != noErr))
     909        {
     910            LogRel(("CoreAudio: Failed to set input stream output format (%RI32)\n", err));
     911            return VERR_AUDIO_BACKEND_INIT_FAILED;
     912        }
     913
     914        err = AudioUnitSetProperty(pStreamIn->audioUnit,
     915                                   kAudioUnitProperty_StreamFormat,
     916                                   kAudioUnitScope_Input,
     917                                   1,
     918                                   &pStreamIn->deviceFormat,
     919                                   sizeof(pStreamIn->deviceFormat));
     920        if (RT_UNLIKELY(err != noErr))
     921        {
     922            LogRel(("CoreAudio: Failed to set stream input format (%RI32)\n", err));
     923            return VERR_AUDIO_BACKEND_INIT_FAILED;
     924        }
     925    }
     926    else
     927    {
     928
     929        /* Set the new output format description for the input stream. */
     930        err = AudioUnitSetProperty(pStreamIn->audioUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output,
     931                                   1, &pStreamIn->streamFormat, sizeof(pStreamIn->streamFormat));
     932        if (err != noErr)
     933        {
     934            LogRel(("CoreAudio: Failed to set output format for input stream (%RI32)\n", err));
     935            return VERR_AUDIO_BACKEND_INIT_FAILED;
     936        }
    910937    }
    911938
     
    13841411            rc = AudioMixBufMixToParent(&pHstStrmIn->MixBuf, cWrittenTotal, &cCaptured);
    13851412
    1386         LogFlowFunc(("cWrittenTotal=%RU32 (%RU32 bytes), cCaptured, rc=%Rrc\n", cWrittenTotal, cbWrittenTotal, cCaptured, rc));
     1413        LogFlowFunc(("cWrittenTotal=%RU32 (%RU32 bytes), cCaptured=%RU32, rc=%Rrc\n", cWrittenTotal, cbWrittenTotal, cCaptured, rc));
    13871414
    13881415        if (pcSamplesCaptured)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette