VirtualBox

Changeset 89533 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Jun 7, 2021 12:55:08 AM (4 years ago)
Author:
vboxsync
Message:

DrvHostAudioAlsa: Don't call the output/input device 'default'. bugref:9890

File:
1 edited

Legend:

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

    r89510 r89533  
    109109    RTCRITSECT          CritSect;
    110110    /** Default input device name.   */
    111     char                szDefaultIn[256];
     111    char                szInputDev[256];
    112112    /** Default output device name. */
    113     char                szDefaultOut[256];
     113    char                szOutputDev[256];
    114114    /** Upwards notification interface. */
    115115    PPDMIHOSTAUDIOPORT  pIHostAudioPort;
     
    369369    {
    370370        size_t cch = strlen(pszId);
    371         AssertReturn(cch < sizeof(pThis->szDefaultIn), VERR_INVALID_NAME);
     371        AssertReturn(cch < sizeof(pThis->szInputDev), VERR_INVALID_NAME);
    372372    }
    373373    LogFunc(("enmDir=%d pszId=%s\n", enmDir, pszId));
     
    380380        int rc = RTCritSectEnter(&pThis->CritSect);
    381381        AssertRCReturn(rc, rc);
    382         if (strcmp(pThis->szDefaultIn, pszId) == 0)
     382        if (strcmp(pThis->szInputDev, pszId) == 0)
    383383            RTCritSectLeave(&pThis->CritSect);
    384384        else
    385385        {
    386             LogRel(("ALSA: Default input device: '%s' -> '%s'\n", pThis->szDefaultIn, pszId));
    387             RTStrCopy(pThis->szDefaultIn, sizeof(pThis->szDefaultIn), pszId);
     386            LogRel(("ALSA: Changing input device: '%s' -> '%s'\n", pThis->szInputDev, pszId));
     387            RTStrCopy(pThis->szInputDev, sizeof(pThis->szInputDev), pszId);
    388388            PPDMIHOSTAUDIOPORT pIHostAudioPort = pThis->pIHostAudioPort;
    389389            RTCritSectLeave(&pThis->CritSect);
    390390            if (pIHostAudioPort)
    391391            {
    392                 LogFlowFunc(("Notifying parent driver about input default device change...\n"));
     392                LogFlowFunc(("Notifying parent driver about input device change...\n"));
    393393                pIHostAudioPort->pfnNotifyDeviceChanged(pIHostAudioPort, PDMAUDIODIR_IN, NULL /*pvUser*/);
    394394            }
     
    403403        int rc = RTCritSectEnter(&pThis->CritSect);
    404404        AssertRCReturn(rc, rc);
    405         if (strcmp(pThis->szDefaultOut, pszId) == 0)
     405        if (strcmp(pThis->szOutputDev, pszId) == 0)
    406406            RTCritSectLeave(&pThis->CritSect);
    407407        else
    408408        {
    409             LogRel(("ALSA: Default output device: '%s' -> '%s'\n", pThis->szDefaultOut, pszId));
    410             RTStrCopy(pThis->szDefaultOut, sizeof(pThis->szDefaultOut), pszId);
     409            LogRel(("ALSA: Changing output device: '%s' -> '%s'\n", pThis->szOutputDev, pszId));
     410            RTStrCopy(pThis->szOutputDev, sizeof(pThis->szOutputDev), pszId);
    411411            PPDMIHOSTAUDIOPORT pIHostAudioPort = pThis->pIHostAudioPort;
    412412            RTCritSectLeave(&pThis->CritSect);
    413413            if (pIHostAudioPort)
    414414            {
    415                 LogFlowFunc(("Notifying parent driver about output default device change...\n"));
     415                LogFlowFunc(("Notifying parent driver about output device change...\n"));
    416416                pIHostAudioPort->pfnNotifyDeviceChanged(pIHostAudioPort, PDMAUDIODIR_OUT, NULL /*pvUser*/);
    417417            }
     
    730730    int                rc      = VERR_AUDIO_STREAM_COULD_NOT_CREATE;
    731731    const char * const pszType = pCfgReq->enmDir == PDMAUDIODIR_IN ? "input" : "output";
    732     const char * const pszDev  = pCfgReq->enmDir == PDMAUDIODIR_IN ? pThis->szDefaultIn : pThis->szDefaultOut;
     732    const char * const pszDev  = pCfgReq->enmDir == PDMAUDIODIR_IN ? pThis->szInputDev : pThis->szOutputDev;
    733733    snd_pcm_stream_t   enmType = pCfgReq->enmDir == PDMAUDIODIR_IN ? SND_PCM_STREAM_CAPTURE : SND_PCM_STREAM_PLAYBACK;
    734734
     
    15021502    PDMDRV_VALIDATE_CONFIG_RETURN(pDrvIns, "OutputDeviceID|InputDeviceID", "");
    15031503
    1504     rc = CFGMR3QueryStringDef(pCfg, "InputDeviceID", pThis->szDefaultIn, sizeof(pThis->szDefaultIn), "default");
     1504    rc = CFGMR3QueryStringDef(pCfg, "InputDeviceID", pThis->szInputDev, sizeof(pThis->szInputDev), "default");
    15051505    AssertRCReturn(rc, rc);
    1506     rc = CFGMR3QueryStringDef(pCfg, "OutputDeviceID", pThis->szDefaultOut, sizeof(pThis->szDefaultOut), "default");
     1506    rc = CFGMR3QueryStringDef(pCfg, "OutputDeviceID", pThis->szOutputDev, sizeof(pThis->szOutputDev), "default");
    15071507    AssertRCReturn(rc, rc);
    15081508
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