VirtualBox

Changeset 89583 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Jun 9, 2021 2:10:21 PM (4 years ago)
Author:
vboxsync
Message:

DrvAudio: Fixed missing pre-buffer allocation alignment for some odd situations. bugref:9890

File:
1 edited

Legend:

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

    r89570 r89583  
    16181618        if (pStreamEx->Core.Cfg.Backend.cFramesPreBuffering != 0)
    16191619        {
    1620             pStreamEx->Out.cbPreBufAlloc     = PDMAudioPropsFramesToBytes(&pStreamEx->Core.Cfg.Props,
    1621                                                                           pStreamEx->Core.Cfg.Backend.cFramesBufferSize - 2);
    1622             pStreamEx->Out.cbPreBufAlloc     = RT_MIN(RT_ALIGN_32(pStreamEx->cbPreBufThreshold + _8K, _4K),
    1623                                                       pStreamEx->Out.cbPreBufAlloc);
    1624             pStreamEx->Out.pbPreBuf          = (uint8_t *)RTMemAllocZ(pStreamEx->Out.cbPreBufAlloc);
     1620            uint32_t cbPreBufAlloc = PDMAudioPropsFramesToBytes(&pStreamEx->Core.Cfg.Props,
     1621                                                                pStreamEx->Core.Cfg.Backend.cFramesBufferSize);
     1622            cbPreBufAlloc = RT_MIN(RT_ALIGN_32(pStreamEx->cbPreBufThreshold + _8K, _4K), cbPreBufAlloc);
     1623            cbPreBufAlloc = PDMAudioPropsFloorBytesToFrame(&pStreamEx->Core.Cfg.Props, cbPreBufAlloc);
     1624            pStreamEx->Out.cbPreBufAlloc     = cbPreBufAlloc;
     1625            pStreamEx->Out.pbPreBuf          = (uint8_t *)RTMemAllocZ(cbPreBufAlloc);
    16251626            AssertReturn(pStreamEx->Out.pbPreBuf, VERR_NO_MEMORY);
    16261627        }
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