Changeset 89533 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jun 7, 2021 12:55:08 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostAudioAlsa.cpp
r89510 r89533 109 109 RTCRITSECT CritSect; 110 110 /** Default input device name. */ 111 char sz DefaultIn[256];111 char szInputDev[256]; 112 112 /** Default output device name. */ 113 char sz DefaultOut[256];113 char szOutputDev[256]; 114 114 /** Upwards notification interface. */ 115 115 PPDMIHOSTAUDIOPORT pIHostAudioPort; … … 369 369 { 370 370 size_t cch = strlen(pszId); 371 AssertReturn(cch < sizeof(pThis->sz DefaultIn), VERR_INVALID_NAME);371 AssertReturn(cch < sizeof(pThis->szInputDev), VERR_INVALID_NAME); 372 372 } 373 373 LogFunc(("enmDir=%d pszId=%s\n", enmDir, pszId)); … … 380 380 int rc = RTCritSectEnter(&pThis->CritSect); 381 381 AssertRCReturn(rc, rc); 382 if (strcmp(pThis->sz DefaultIn, pszId) == 0)382 if (strcmp(pThis->szInputDev, pszId) == 0) 383 383 RTCritSectLeave(&pThis->CritSect); 384 384 else 385 385 { 386 LogRel(("ALSA: Default input device: '%s' -> '%s'\n", pThis->szDefaultIn, pszId));387 RTStrCopy(pThis->sz DefaultIn, sizeof(pThis->szDefaultIn), pszId);386 LogRel(("ALSA: Changing input device: '%s' -> '%s'\n", pThis->szInputDev, pszId)); 387 RTStrCopy(pThis->szInputDev, sizeof(pThis->szInputDev), pszId); 388 388 PPDMIHOSTAUDIOPORT pIHostAudioPort = pThis->pIHostAudioPort; 389 389 RTCritSectLeave(&pThis->CritSect); 390 390 if (pIHostAudioPort) 391 391 { 392 LogFlowFunc(("Notifying parent driver about input de fault device change...\n"));392 LogFlowFunc(("Notifying parent driver about input device change...\n")); 393 393 pIHostAudioPort->pfnNotifyDeviceChanged(pIHostAudioPort, PDMAUDIODIR_IN, NULL /*pvUser*/); 394 394 } … … 403 403 int rc = RTCritSectEnter(&pThis->CritSect); 404 404 AssertRCReturn(rc, rc); 405 if (strcmp(pThis->sz DefaultOut, pszId) == 0)405 if (strcmp(pThis->szOutputDev, pszId) == 0) 406 406 RTCritSectLeave(&pThis->CritSect); 407 407 else 408 408 { 409 LogRel(("ALSA: Default output device: '%s' -> '%s'\n", pThis->szDefaultOut, pszId));410 RTStrCopy(pThis->sz DefaultOut, sizeof(pThis->szDefaultOut), pszId);409 LogRel(("ALSA: Changing output device: '%s' -> '%s'\n", pThis->szOutputDev, pszId)); 410 RTStrCopy(pThis->szOutputDev, sizeof(pThis->szOutputDev), pszId); 411 411 PPDMIHOSTAUDIOPORT pIHostAudioPort = pThis->pIHostAudioPort; 412 412 RTCritSectLeave(&pThis->CritSect); 413 413 if (pIHostAudioPort) 414 414 { 415 LogFlowFunc(("Notifying parent driver about output de fault device change...\n"));415 LogFlowFunc(("Notifying parent driver about output device change...\n")); 416 416 pIHostAudioPort->pfnNotifyDeviceChanged(pIHostAudioPort, PDMAUDIODIR_OUT, NULL /*pvUser*/); 417 417 } … … 730 730 int rc = VERR_AUDIO_STREAM_COULD_NOT_CREATE; 731 731 const char * const pszType = pCfgReq->enmDir == PDMAUDIODIR_IN ? "input" : "output"; 732 const char * const pszDev = pCfgReq->enmDir == PDMAUDIODIR_IN ? pThis->sz DefaultIn : pThis->szDefaultOut;732 const char * const pszDev = pCfgReq->enmDir == PDMAUDIODIR_IN ? pThis->szInputDev : pThis->szOutputDev; 733 733 snd_pcm_stream_t enmType = pCfgReq->enmDir == PDMAUDIODIR_IN ? SND_PCM_STREAM_CAPTURE : SND_PCM_STREAM_PLAYBACK; 734 734 … … 1502 1502 PDMDRV_VALIDATE_CONFIG_RETURN(pDrvIns, "OutputDeviceID|InputDeviceID", ""); 1503 1503 1504 rc = CFGMR3QueryStringDef(pCfg, "InputDeviceID", pThis->sz DefaultIn, sizeof(pThis->szDefaultIn), "default");1504 rc = CFGMR3QueryStringDef(pCfg, "InputDeviceID", pThis->szInputDev, sizeof(pThis->szInputDev), "default"); 1505 1505 AssertRCReturn(rc, rc); 1506 rc = CFGMR3QueryStringDef(pCfg, "OutputDeviceID", pThis->sz DefaultOut, sizeof(pThis->szDefaultOut), "default");1506 rc = CFGMR3QueryStringDef(pCfg, "OutputDeviceID", pThis->szOutputDev, sizeof(pThis->szOutputDev), "default"); 1507 1507 AssertRCReturn(rc, rc); 1508 1508
Note:
See TracChangeset
for help on using the changeset viewer.