VirtualBox

Changeset 74035 in vbox for trunk/src


Ignore:
Timestamp:
Sep 3, 2018 9:47:49 AM (6 years ago)
Author:
vboxsync
Message:

Audio/DrvHostCoreAudio: Handle 0-byte write blocks in coreAudioInputQueueProcBuffer().

File:
1 edited

Legend:

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

    r74034 r74035  
    13661366
    13671367    size_t cbToWrite = audioBuffer->mAudioDataByteSize;
    1368     size_t cbLeft    = cbToWrite;
     1368    size_t cbLeft    = RT_MIN(cbToWrite, RTCircBufFree(pCircBuf));
    13691369
    13701370    while (cbLeft)
     
    13731373        RTCircBufAcquireWriteBlock(pCircBuf, cbLeft, (void **)&pvDst, &cbToWrite);
    13741374
    1375         if (!cbToWrite)
    1376             break;
    1377 
    1378         /* Copy the data from our ring buffer to the core audio buffer. */
    1379         memcpy((UInt8 *)pvDst, pvSrc + cbWritten, cbToWrite);
     1375        if (cbToWrite)
     1376        {
     1377            /* Copy the data from our ring buffer to the core audio buffer. */
     1378            memcpy((UInt8 *)pvDst, pvSrc + cbWritten, cbToWrite);
     1379        }
    13801380
    13811381        /* Release the read buffer, so it could be used for new data. */
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