VirtualBox

Changeset 67647 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 27, 2017 4:38:49 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
116421
Message:

Audio/DrvAudio.cpp: Bail out in drvAudioStreamPlayRaw() and drvAudioStreamPlayNonInterleaved() if the backend did not play anything.

File:
1 edited

Legend:

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

    r67607 r67647  
    13181318                rc = pThis->pHostDrvAudio->pfnStreamPlay(pThis->pHostDrvAudio, pHstStream->pvBackend,
    13191319                                                         auBuf, cbRead, &cbPlayed);
    1320                 if (RT_FAILURE(rc))
     1320                if (   RT_FAILURE(rc)
     1321                    || !cbPlayed)
     1322                {
    13211323                    break;
     1324                }
    13221325
    13231326#ifdef VBOX_AUDIO_DEBUG_DUMP_PCM_DATA
     
    14001403                && csRead)
    14011404            {
    1402                 uint32_t csPlayedChunk;
    1403 
     1405                uint32_t csPlayed;
     1406
     1407                /* Note: As the stream layout is RPDMAUDIOSTREAMLAYOUT_RAW, operate on audio frames
     1408                 *       rather on bytes. */
    14041409                Assert(csRead <= RT_ELEMENTS(aSampleBuf));
    14051410                rc = pThis->pHostDrvAudio->pfnStreamPlay(pThis->pHostDrvAudio, pHstStream->pvBackend,
    1406                                                          aSampleBuf, csRead, &csPlayedChunk);
    1407                 if (RT_FAILURE(rc))
     1411                                                         aSampleBuf, csRead, &csPlayed);
     1412                if (   RT_FAILURE(rc)
     1413                    || !csPlayed)
     1414                {
    14081415                    break;
    1409 
    1410                 csPlayedTotal += csPlayedChunk;
     1416                }
     1417
     1418                csPlayedTotal += csPlayed;
    14111419                Assert(csPlayedTotal <= csToPlay);
    14121420
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette