Changeset 68067 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jul 20, 2017 2:30:57 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r67834 r68067 1395 1395 RT_MIN(csLeft, RT_ELEMENTS(aSampleBuf)), &csRead); 1396 1396 1397 if ( RT_SUCCESS(rc) 1398 && csRead) 1397 if (RT_SUCCESS(rc)) 1399 1398 { 1400 uint32_t csPlayed; 1401 1402 /* Note: As the stream layout is RPDMAUDIOSTREAMLAYOUT_RAW, operate on audio frames 1403 * rather on bytes. */ 1404 Assert(csRead <= RT_ELEMENTS(aSampleBuf)); 1405 rc = pThis->pHostDrvAudio->pfnStreamPlay(pThis->pHostDrvAudio, pHstStream->pvBackend, 1406 aSampleBuf, csRead, &csPlayed); 1407 if ( RT_FAILURE(rc) 1408 || !csPlayed) 1399 if (csRead) 1409 1400 { 1401 uint32_t csPlayed; 1402 1403 /* Note: As the stream layout is RPDMAUDIOSTREAMLAYOUT_RAW, operate on audio frames 1404 * rather on bytes. */ 1405 Assert(csRead <= RT_ELEMENTS(aSampleBuf)); 1406 rc = pThis->pHostDrvAudio->pfnStreamPlay(pThis->pHostDrvAudio, pHstStream->pvBackend, 1407 aSampleBuf, csRead, &csPlayed); 1408 if ( RT_FAILURE(rc) 1409 || !csPlayed) 1410 { 1411 break; 1412 } 1413 1414 csPlayedTotal += csPlayed; 1415 Assert(csPlayedTotal <= csToPlay); 1416 1417 Assert(csLeft >= csRead); 1418 csLeft -= csRead; 1419 } 1420 else 1421 { 1422 if (rc == VINF_AUDIO_MORE_DATA_AVAILABLE) /* Do another peeking round if there is more data available. */ 1423 continue; 1424 1410 1425 break; 1411 1426 } 1412 1413 csPlayedTotal += csPlayed;1414 Assert(csPlayedTotal <= csToPlay);1415 1416 Assert(csLeft >= csRead);1417 csLeft -= csRead;1418 1427 } 1419 1428 else if (RT_FAILURE(rc))
Note:
See TracChangeset
for help on using the changeset viewer.