VirtualBox

Changeset 54974 in vbox


Ignore:
Timestamp:
Mar 26, 2015 7:10:45 PM (10 years ago)
Author:
vboxsync
Message:

PDM/DrvAudio.cpp: Handle ADC rate conversion as well.

File:
1 edited

Legend:

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

    r54969 r54974  
    619619     * Try figuring out which audio stream configuration this backend
    620620     * should use. If fixed output is enabled the backend will be tied
    621      * to a fixed rate in (Hz), regardless of what the backend could do else.
     621     * to a fixed rate (in Hz, among other parameters), regardless of
     622     * what the backend could do else.
    622623     */
    623624    PPDMAUDIOSTREAMCFG pBackendCfg;
     
    679680    AssertPtrReturn(pszName, VERR_INVALID_POINTER);
    680681
    681     PPDMAUDIOSTREAMCFG pThisCfg;
     682/*
     683     * Try figuring out which audio stream configuration this backend
     684     * should use for the audio input data. If fixed input is enabled
     685     * the backend will be tied to a fixed rate (in Hz, among other parameters),
     686     * regardless of what the backend initially wanted to use.
     687     */
     688    PPDMAUDIOSTREAMCFG pBackendCfg;
    682689    if (conf.fixed_in.enabled)
    683     {
    684         pThisCfg = &conf.fixed_in.settings;
    685         LogFlowFunc(("Using fixed audio settings\n"));
    686     }
     690        pBackendCfg = &conf.fixed_in.settings;
    687691    else
    688         pThisCfg = pCfg;
    689     AssertPtrReturn(pThisCfg, VERR_INVALID_POINTER);
     692        pBackendCfg = pCfg;
     693
     694    AssertPtrReturn(pBackendCfg, VERR_INVALID_POINTER);
     695
     696    LogFlowFunc(("Using fixed audio input settings: %RTbool\n",
     697                 RT_BOOL(conf.fixed_in.enabled)));
    690698
    691699    PPDMAUDIOGSTSTRMIN pGstStrmIn = (PPDMAUDIOGSTSTRMIN)RTMemAllocZ(sizeof(PDMAUDIOGSTSTRMIN));
     
    693701        return VERR_NO_MEMORY;
    694702
    695 
     703    /*
     704     * The host stream always will get the backend audio stream configuration.
     705     */
    696706    PPDMAUDIOHSTSTRMIN pHstStrmIn;
    697     int rc = drvAudioHstInAdd(pThis, pszName, pThisCfg, enmRecSource, &pHstStrmIn);
     707    int rc = drvAudioHstInAdd(pThis, pszName, pBackendCfg, enmRecSource, &pHstStrmIn);
    698708    if (RT_FAILURE(rc))
    699709    {
     
    704714    }
    705715
    706     rc = drvAudioGstInInit(pGstStrmIn, pHstStrmIn, pszName, pThisCfg);
     716    /*
     717     * The guest stream always will get the audio stream configuration told
     718     * by the device emulation (which in turn was/could be set by the guest OS).
     719     */
     720    rc = drvAudioGstInInit(pGstStrmIn, pHstStrmIn, pszName, pCfg);
    707721    if (RT_SUCCESS(rc))
    708722    {
     
    744758            return VERR_NO_MEMORY;
    745759
    746         rc = audioMixBufInit(&pGstStrmIn->MixBuf, pszTemp, &pHstStrmIn->Props,
     760        rc = audioMixBufInit(&pGstStrmIn->MixBuf, pszTemp, &pGstStrmIn->Props,
    747761                             audioMixBufSize(&pHstStrmIn->MixBuf));
    748762        if (RT_SUCCESS(rc))
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