VirtualBox

Changeset 87587 in vbox


Ignore:
Timestamp:
Feb 3, 2021 4:46:12 PM (4 years ago)
Author:
vboxsync
Message:

Audio/HDA: Re-applied r142615 as intended: More timing-related fixes for Windows guests. This is a risky change and needs more testing / verification on other guests. Only got limited testing for Win10 AU / Win10 20H2 and Ubuntu 20.10 guests so far [build fix]. ticketoem2ref:36

File:
1 edited

Legend:

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

    r87586 r87587  
    2929#include <VBox/vmm/pdmdev.h>
    3030#include <VBox/vmm/pdmaudioifs.h>
    31 
    32 #include <math.h> /* Needed for roundl(). */
    3331
    3432#include "DrvAudio.h"
     
    548546                const double cTicksPerByte = cTicksPerHz / (double)pStreamShared->State.cbTransferChunk;
    549547
     548#define HDA_ROUND_NEAREST(a_X) ((a_X) >= 0 ? (uint32_t)((a_X) + 0.5) : (uint32_t)((a_X) - 0.5)) /** @todo r=andy Do we have rounding in IPRT? */
     549
    550550                /* Calculate the timer ticks per byte for this stream. */
    551                 pStreamShared->State.cTicksPerByte = roundl(cTicksPerByte); /** @todo r=andy Do we have rounding in IPRT? */
     551                pStreamShared->State.cTicksPerByte = HDA_ROUND_NEAREST(cTicksPerByte);
    552552                Assert(pStreamShared->State.cTicksPerByte);
    553553
     
    555555
    556556                /* Calculate timer ticks per transfer. */
    557                 pStreamShared->State.cTransferTicks = roundl(cTransferTicks);
     557                pStreamShared->State.cTransferTicks = HDA_ROUND_NEAREST(cTransferTicks);
    558558                Assert(pStreamShared->State.cTransferTicks);
     559
     560#undef HDA_ROUND_NEAREST
    559561
    560562                LogRel2(("HDA: Stream #%RU8 is using %uHz device timer (%RU64 virtual ticks / Hz), stream Hz=%RU32, "
     
    21102112
    21112113#endif /* IN_RING3 */
    2112 
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