Changeset 73570 in vbox for trunk/src/VBox
- Timestamp:
- Aug 8, 2018 3:28:35 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r73569 r73570 863 863 pStream->szName, pStream->enmDir)); 864 864 865 AssertMsg(DrvAudioHlpBytesIsAligned(cbBuf, &pStream->Guest.Cfg.Props), 866 ("Writing audio data (%RU32 bytes) to stream '%s' is not properly aligned\n", cbBuf, pStream->szName)); 867 865 868 uint32_t cbWrittenTotal = 0; 866 869 … … 874 877 875 878 #ifdef LOG_ENABLED 876 char *pszStreamSts = NULL; 879 char *pszStreamSts = dbgAudioStreamStatusToStr(pStream->fStatus); 880 AssertPtr(pszStreamSts); 877 881 #endif 878 882 879 883 do 880 884 { 881 if (!pThis->Out.fEnabled) 882 { 883 cbWrittenTotal = cbBuf; 885 if ( !pThis->Out.fEnabled 886 || !DrvAudioHlpStreamStatusIsReady(pStream->fStatus)) 887 { 888 rc = VERR_AUDIO_STREAM_NOT_READY; 884 889 break; 885 890 } … … 889 894 && pThis->pHostDrvAudio->pfnGetStatus(pThis->pHostDrvAudio, PDMAUDIODIR_OUT) != PDMAUDIOBACKENDSTS_RUNNING) 890 895 { 891 rc = VERR_NOT_AVAILABLE; 892 break; 893 } 894 895 AssertMsg(DrvAudioHlpBytesIsAligned(cbBuf, &pStream->Guest.Cfg.Props), 896 ("Writing audio data (%RU32 bytes) to stream '%s' is not properly aligned\n", cbBuf, pStream->szName)); 897 898 #ifdef LOG_ENABLED 899 pszStreamSts = dbgAudioStreamStatusToStr(pStream->fStatus); 900 AssertPtr(pszStreamSts); 901 #endif 902 if (!(pStream->fStatus & PDMAUDIOSTREAMSTS_FLAG_ENABLED)) 903 { 904 Log3Func(("[%s] Writing to disabled guest output stream not possible (status is %s)\n", 905 pStream->szName, pszStreamSts)); 906 #ifdef DEBUG_andy 907 AssertFailed(); 908 #endif 909 rc = VERR_NOT_AVAILABLE; 896 rc = VERR_AUDIO_STREAM_NOT_READY; 910 897 break; 911 898 } … … 921 908 922 909 if (!cbToWrite) 910 { 911 rc = VERR_BUFFER_OVERFLOW; 923 912 break; 913 } 924 914 925 915 /* We use the guest side mixing buffer as an intermediate buffer to do some … … 987 977 } while (0); 988 978 989 Log3Func(("[%s] fEnabled=%RTbool, cbWrittenTotal=%RU32, rc=%Rrc\n", 990 pStream->szName, pThis->Out.fEnabled, cbWrittenTotal, rc)); 979 Log3Func(("[%s] cbWrittenTotal=%RU32, rc=%Rrc\n", pStream->szName, cbWrittenTotal, rc)); 991 980 992 981 #ifdef LOG_ENABLED … … 1403 1392 uint32_t cfPlayedTotal = 0; 1404 1393 1405 if (!pThis->pHostDrvAudio)1406 return VINF_SUCCESS;1407 1408 1394 PDMAUDIOSTREAMSTS stsStream = pStream->fStatus; 1409 1395 #ifdef LOG_ENABLED … … 1415 1401 do 1416 1402 { 1417 /* 1418 * Check if the backend is ready to operate. 1419 */ 1420 if (!(stsStream & PDMAUDIOSTREAMSTS_FLAG_ENABLED)) /* Stream disabled? Bail out. */ 1403 if (!pThis->pHostDrvAudio) 1404 { 1405 rc = VERR_AUDIO_STREAM_NOT_READY; 1421 1406 break; 1422 1407 } 1408 1409 if ( !pThis->Out.fEnabled 1410 || !DrvAudioHlpStreamStatusIsReady(stsStream)) 1411 { 1412 rc = VERR_AUDIO_STREAM_NOT_READY; 1413 break; 1414 } 1423 1415 uint32_t cfLive = AudioMixBufLive(&pStream->Host.MixBuf); 1424 1416 const uint8_t uLivePercent = (100 * cfLive) / AudioMixBufSize(&pStream->Host.MixBuf);
Note:
See TracChangeset
for help on using the changeset viewer.