VirtualBox

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


Ignore:
Timestamp:
Jul 27, 2018 9:12:35 AM (6 years ago)
Author:
vboxsync
Message:

Audio/DrvAudioCommon.cpp: Reordering helper function parameters to emphasize the function usage (namespace) better. No functional changes.

Location:
trunk/src/VBox/Devices/Audio
Files:
9 edited

Legend:

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

    r73370 r73380  
    653653    if (RT_SUCCESS(rc))
    654654    {
    655         rc = RTCircBufCreate(&pMixStream->pCircBuf, DrvAudioHlpMsToBytes(&pSink->PCMProps, 100 /* ms */)); /** @todo Make this configurable. */
     655        rc = RTCircBufCreate(&pMixStream->pCircBuf, DrvAudioHlpMsToBytes(100 /* ms */, &pSink->PCMProps)); /** @todo Make this configurable. */
    656656        AssertRC(rc);
    657657    }
     
    859859#else
    860860        /* Return how much data we can deliver since the last read. */
    861         cbReadable = DrvAudioHlpMsToBytes(&pSink->PCMProps, RTTimeMilliTS() - pSink->tsLastReadWrittenMs);
     861        cbReadable = DrvAudioHlpMsToBytes(RTTimeMilliTS() - pSink->tsLastReadWrittenMs, &pSink->PCMProps);
    862862#endif
    863863    }
     
    897897#else
    898898        /* Return how much data we expect since the last write. */
    899         cbWritable = DrvAudioHlpMsToBytes(&pSink->PCMProps, RTTimeMilliTS() - pSink->tsLastReadWrittenMs);
     899        cbWritable = DrvAudioHlpMsToBytes(RTTimeMilliTS() - pSink->tsLastReadWrittenMs, &pSink->PCMProps);
    900900#endif
    901901    }
  • trunk/src/VBox/Devices/Audio/DrvAudio.cpp

    r73370 r73380  
    667667
    668668    /* If no own pre-buffer is set, let the backend choose. */
    669     uint32_t msPreBuf = DrvAudioHlpFramesToMs(&pCfgHost->Props, CfgHostAcq.Backend.cfPreBuf);
     669    uint32_t msPreBuf = DrvAudioHlpFramesToMs(CfgHostAcq.Backend.cfPreBuf, &pCfgHost->Props);
    670670    LogRel2(("Audio: Pre-buffering size of stream '%s' is %RU32ms (%RU32 frames)\n",
    671671             pHstStream->szName, msPreBuf, CfgHostAcq.Backend.cfPreBuf));
    672672
    673673    /* Make sure the configured buffer size by the backend at least can hold the configured latency. */
    674     const uint32_t msPeriod = DrvAudioHlpFramesToMs(&pCfgHost->Props, CfgHostAcq.Backend.cfPeriod);
     674    const uint32_t msPeriod = DrvAudioHlpFramesToMs(CfgHostAcq.Backend.cfPeriod, &pCfgHost->Props);
    675675
    676676    LogRel2(("Audio: Period size of stream '%s' is %RU32ms (%RU32 frames)\n",
     
    685685    }
    686686
    687     uint32_t msBufferSize = DrvAudioHlpFramesToMs(&pCfgHost->Props, CfgHostAcq.Backend.cfBufferSize);
     687    uint32_t msBufferSize = DrvAudioHlpFramesToMs(CfgHostAcq.Backend.cfBufferSize, &pCfgHost->Props);
    688688
    689689    LogRel2(("Audio: Buffer size of stream '%s' is %RU32ms (%RU32 frames)\n",
     
    993993        if (cbFree < cbBuf) /* No space left on host side? Bail out. */
    994994            LogRel2(("Audio: Lost audio frames (%RU32) due to full host stream '%s', expect stuttering audio output\n",
    995                      DrvAudioHlpBytesToFrames(&pHstStream->Cfg.Props, cbBuf - cbFree), pHstStream->szName));
     995                     DrvAudioHlpBytesToFrames(cbBuf - cbFree, &pHstStream->Cfg.Props), pHstStream->szName));
    996996
    997997        uint32_t cbToWrite = RT_MIN(cbBuf, cbFree);
     
    10441044            {
    10451045                Log3Func(("[%s] Buffer: Last written %RU64ms, writing %RU32 frames (%RU64ms), now filled with %RU64ms -- %RU8%%\n",
    1046                           pHstStream->szName, tsDeltaWrittenMs, cfGstWritten, DrvAudioHlpFramesToMs(&pHstStream->Cfg.Props, cfGstWritten),
    1047                           DrvAudioHlpFramesToMs(&pHstStream->Cfg.Props, AudioMixBufUsed(&pHstStream->MixBuf)),
     1046                          pHstStream->szName, tsDeltaWrittenMs, cfGstWritten, DrvAudioHlpFramesToMs(cfGstWritten, &pHstStream->Cfg.Props),
     1047                          DrvAudioHlpFramesToMs(AudioMixBufUsed(&pHstStream->MixBuf), &pHstStream->Cfg.Props),
    10481048                          AudioMixBufUsed(&pHstStream->MixBuf) * 100 / AudioMixBufSize(&pHstStream->MixBuf)));
    10491049
     
    15991599        Log3Func(("[%s] Buffer: Last played %RU64ms, filled with %RU64ms (%RU8%%) total, "
    16001600                  "(cfLive=%RU32, fThresholdReached=%RTbool)\n",
    1601                   pHstStream->szName, tsDeltaPlayedCapturedMs, DrvAudioHlpFramesToMs(&pHstStream->Cfg.Props, cfLive),
     1601                  pHstStream->szName, tsDeltaPlayedCapturedMs, DrvAudioHlpFramesToMs(cfLive, &pHstStream->Cfg.Props),
    16021602                  uLivePercent, cfLive, pHstStream->fThresholdReached));
    16031603#endif
     
    16451645                cfToPlay = pHstStream->Cfg.Backend.cfPeriod;
    16461646            else
    1647                 cfToPlay = DrvAudioHlpMsToFrames(&pHstStream->Cfg.Props, tsDeltaPlayedCapturedMs);
     1647                cfToPlay = DrvAudioHlpMsToFrames(tsDeltaPlayedCapturedMs, &pHstStream->Cfg.Props);
    16481648
    16491649            Log3Func(("[%s] Buffer: fJustStarted=%RTbool, cfLive=%RU32, cfToPlay=%RU32\n",
     
    32563256     */
    32573257    if (pDrvCfg->uPeriodMs)
    3258         pCfgReq->Backend.cfPeriod = DrvAudioHlpMsToFrames(&pCfgReq->Props, pDrvCfg->uPeriodMs);
     3258        pCfgReq->Backend.cfPeriod = DrvAudioHlpMsToFrames(pDrvCfg->uPeriodMs, &pCfgReq->Props);
    32593259    else /* Set default period size. */
    3260         pCfgReq->Backend.cfPeriod = DrvAudioHlpMsToFrames(&pCfgReq->Props, 50 /* ms */);
     3260        pCfgReq->Backend.cfPeriod = DrvAudioHlpMsToFrames(50 /* ms */, &pCfgReq->Props);
    32613261
    32623262    LogRel2(("Audio: Using %s period size (%RU32ms, %RU32 frames) for stream '%s'\n",
    3263              pDrvCfg->uPeriodMs ? "custom" : "default", DrvAudioHlpFramesToMs(&pCfgReq->Props, pCfgReq->Backend.cfPeriod),
     3263             pDrvCfg->uPeriodMs ? "custom" : "default", DrvAudioHlpFramesToMs(pCfgReq->Backend.cfPeriod, &pCfgReq->Props),
    32643264             pCfgReq->Backend.cfPeriod, pHstStream->szName));
    32653265
     
    32683268     */
    32693269    if (pDrvCfg->uBufferSizeMs)
    3270         pCfgReq->Backend.cfBufferSize = DrvAudioHlpMsToFrames(&pCfgReq->Props, pDrvCfg->uBufferSizeMs);
     3270        pCfgReq->Backend.cfBufferSize = DrvAudioHlpMsToFrames(pDrvCfg->uBufferSizeMs, &pCfgReq->Props);
    32713271    else /* Set default buffer size. */
    3272         pCfgReq->Backend.cfBufferSize = DrvAudioHlpMsToFrames(&pCfgReq->Props, 200 /* ms */);
     3272        pCfgReq->Backend.cfBufferSize = DrvAudioHlpMsToFrames(200 /* ms */, &pCfgReq->Props);
    32733273
    32743274    LogRel2(("Audio: Using %s buffer size (%RU32ms, %RU32 frames) for stream '%s'\n",
    3275              pDrvCfg->uBufferSizeMs ? "custom" : "default", DrvAudioHlpFramesToMs(&pCfgReq->Props, pCfgReq->Backend.cfBufferSize),
     3275             pDrvCfg->uBufferSizeMs ? "custom" : "default", DrvAudioHlpFramesToMs(pCfgReq->Backend.cfBufferSize, &pCfgReq->Props),
    32763276             pCfgReq->Backend.cfBufferSize, pHstStream->szName));
    32773277
     
    32833283        if (!pDrvCfg->uPreBufMs) /* Pre-buffering is set to disabled. */
    32843284            LogRel2(("Audio: Using custom pre-buffering (disabled) for stream '%s'\n", pHstStream->szName));
    3285         pCfgReq->Backend.cfPreBuf = DrvAudioHlpMsToFrames(&pCfgReq->Props, pDrvCfg->uPreBufMs);
     3285        pCfgReq->Backend.cfPreBuf = DrvAudioHlpMsToFrames(pDrvCfg->uPreBufMs, &pCfgReq->Props);
    32863286    }
    32873287    else /* Set default pre-buffering size. */
     
    32893289
    32903290    LogRel2(("Audio: Using %s pre-buffering size (%RU32ms, %RU32 frames) for stream '%s'\n",
    3291              pDrvCfg->uPreBufMs != UINT32_MAX ? "custom" : "default", DrvAudioHlpFramesToMs(&pCfgReq->Props, pCfgReq->Backend.cfPreBuf),
     3291             pDrvCfg->uPreBufMs != UINT32_MAX ? "custom" : "default", DrvAudioHlpFramesToMs(pCfgReq->Backend.cfPreBuf, &pCfgReq->Props),
    32923292             pCfgReq->Backend.cfPreBuf, pHstStream->szName));
    32933293
     
    32983298    {
    32993299        LogRel(("Audio: Error for stream '%s': Buffer size (%RU32ms) must not be smaller than the period size (%RU32ms)\n",
    3300                 pHstStream->szName, DrvAudioHlpFramesToMs(&pCfgReq->Props, pCfgReq->Backend.cfBufferSize),
    3301                 DrvAudioHlpFramesToMs(&pCfgReq->Props, pCfgReq->Backend.cfPeriod)));
     3300                pHstStream->szName, DrvAudioHlpFramesToMs(pCfgReq->Backend.cfBufferSize, &pCfgReq->Props),
     3301                DrvAudioHlpFramesToMs(pCfgReq->Backend.cfPeriod, &pCfgReq->Props)));
    33023302        return VERR_INVALID_PARAMETER;
    33033303    }
     
    33093309        {
    33103310            LogRel(("Audio: Error for stream '%s': Pre-buffering size (%RU32ms) must not be bigger than the buffer size (%RU32ms)\n",
    3311                     pHstStream->szName, DrvAudioHlpFramesToMs(&pCfgReq->Props, pCfgReq->Backend.cfPreBuf),
    3312                     DrvAudioHlpFramesToMs(&pCfgReq->Props, pCfgReq->Backend.cfBufferSize)));
     3311                    pHstStream->szName, DrvAudioHlpFramesToMs(pCfgReq->Backend.cfPreBuf, &pCfgReq->Props),
     3312                    DrvAudioHlpFramesToMs(pCfgReq->Backend.cfBufferSize, &pCfgReq->Props)));
    33133313            return VERR_INVALID_PARAMETER;
    33143314        }
     
    33483348    {
    33493349        LogRel2(("Audio: Custom buffer size overwritten by backend for stream '%s' (now %RU64ms, %RU32 frames)\n",
    3350                  pHstStream->szName, DrvAudioHlpFramesToMs(&pCfgAcq->Props, pCfgAcq->Backend.cfBufferSize), pCfgAcq->Backend.cfBufferSize));
     3350                 pHstStream->szName, DrvAudioHlpFramesToMs(pCfgAcq->Backend.cfBufferSize, &pCfgAcq->Props), pCfgAcq->Backend.cfBufferSize));
    33513351    }
    33523352
     
    33553355    {
    33563356        LogRel2(("Audio: Custom period size overwritten by backend for stream '%s' (now %RU64ms, %RU32 frames)\n",
    3357                  pHstStream->szName, DrvAudioHlpFramesToMs(&pCfgAcq->Props, pCfgAcq->Backend.cfPeriod), pCfgAcq->Backend.cfPeriod));
     3357                 pHstStream->szName, DrvAudioHlpFramesToMs(pCfgAcq->Backend.cfPeriod, &pCfgAcq->Props), pCfgAcq->Backend.cfPeriod));
    33583358    }
    33593359
     
    33623362    {
    33633363        LogRel2(("Audio: Custom pre-buffering size overwritten by backend for stream '%s' (now %RU64ms, %RU32 frames)\n",
    3364                  pHstStream->szName, DrvAudioHlpFramesToMs(&pCfgAcq->Props, pCfgAcq->Backend.cfPreBuf), pCfgAcq->Backend.cfPreBuf));
     3364                 pHstStream->szName, DrvAudioHlpFramesToMs(pCfgAcq->Backend.cfPreBuf, &pCfgAcq->Props), pCfgAcq->Backend.cfPreBuf));
    33653365    }
    33663366
  • trunk/src/VBox/Devices/Audio/DrvAudio.h

    r73379 r73380  
    186186uint32_t DrvAudioHlpBytesAlign(uint32_t cbSize, const PPDMAUDIOPCMPROPS pProps);
    187187bool     DrvAudioHlpBytesIsAligned(uint32_t cbSize, const PPDMAUDIOPCMPROPS pProps);
    188 uint32_t DrvAudioHlpBytesToFrames(const PPDMAUDIOPCMPROPS pProps, uint32_t cbBytes);
    189 uint64_t DrvAudioHlpBytesToMs(const PPDMAUDIOPCMPROPS pProps, uint32_t cbBytes);
    190 uint32_t DrvAudioHlpFramesToBytes(const PPDMAUDIOPCMPROPS pProps, uint32_t cFrames);
    191 uint64_t DrvAudioHlpFramesToMs(const PPDMAUDIOPCMPROPS pProps, uint32_t cFrames);
    192 uint32_t DrvAudioHlpMsToBytes(const PPDMAUDIOPCMPROPS pProps, uint32_t uMs);
    193 uint32_t DrvAudioHlpMsToFrames(const PPDMAUDIOPCMPROPS pProps, uint32_t uMs);
     188uint32_t DrvAudioHlpBytesToFrames(uint32_t cbBytes, const PPDMAUDIOPCMPROPS pProps);
     189uint64_t DrvAudioHlpBytesToMs(uint32_t cbBytes, const PPDMAUDIOPCMPROPS pProps);
     190uint32_t DrvAudioHlpFramesToBytes(uint32_t cFrames, const PPDMAUDIOPCMPROPS pProps);
     191uint64_t DrvAudioHlpFramesToMs(uint32_t cFrames, const PPDMAUDIOPCMPROPS pProps);
     192uint32_t DrvAudioHlpMsToBytes(uint32_t uMs, const PPDMAUDIOPCMPROPS pProps);
     193uint32_t DrvAudioHlpMsToFrames(uint32_t uMs, const PPDMAUDIOPCMPROPS pProps);
    194194/** @}  */
    195195
  • trunk/src/VBox/Devices/Audio/DrvAudioCommon.cpp

    r73379 r73380  
    137137
    138138    Assert(pPCMProps->cBits);
    139     size_t cbToClear = DrvAudioHlpFramesToBytes(pPCMProps, cFrames);
     139    size_t cbToClear = DrvAudioHlpFramesToBytes(cFrames, pPCMProps);
    140140    Assert(cbBuf >= cbToClear);
    141141
     
    167167                uint16_t  s = 0x8000;
    168168
    169                 for (uint32_t i = 0; i < DrvAudioHlpBytesToFrames(pPCMProps, (uint32_t)cbToClear); i++)
     169                for (uint32_t i = 0; i < DrvAudioHlpBytesToFrames((uint32_t)cbToClear, pPCMProps); i++)
    170170                    p[i] = s;
    171171
     
    180180                uint32_t  s = 0x80000000;
    181181
    182                 for (uint32_t i = 0; i < DrvAudioHlpBytesToFrames(pPCMProps, (uint32_t)cbToClear); i++)
     182                for (uint32_t i = 0; i < DrvAudioHlpBytesToFrames((uint32_t)cbToClear, pPCMProps); i++)
    183183                    p[i] = s;
    184184
     
    11031103 *
    11041104 * @return Calculated audio frames for given bytes.
     1105 * @param  cbBytes              Bytes to convert to audio frames.
    11051106 * @param  pProps               PCM properties to calulate frames for.
    1106  * @param  cbBytes              Bytes to convert to audio frames.
    1107  */
    1108 uint32_t DrvAudioHlpBytesToFrames(const PPDMAUDIOPCMPROPS pProps, uint32_t cbBytes)
     1107 */
     1108uint32_t DrvAudioHlpBytesToFrames(uint32_t cbBytes, const PPDMAUDIOPCMPROPS pProps)
    11091109{
    11101110    AssertPtrReturn(pProps, 0);
     
    11171117 *
    11181118 * @return  uint64_t            Calculated time (in ms).
     1119 * @param   cbBytes             Amount of bytes to calculate time for.
    11191120 * @param   pProps              PCM properties to calculate amount of bytes for.
    1120  * @param   cbBytes             Amount of bytes to calculate time for.
    1121  */
    1122 uint64_t DrvAudioHlpBytesToMs(const PPDMAUDIOPCMPROPS pProps, uint32_t cbBytes)
     1121 */
     1122uint64_t DrvAudioHlpBytesToMs(uint32_t cbBytes, const PPDMAUDIOPCMPROPS pProps)
    11231123{
    11241124    AssertPtrReturn(pProps, 0);
     
    11391139 *
    11401140 * @return Calculated bytes for given audio frames.
     1141 * @param  cFrames              Amount of audio frames to calculate bytes for.
    11411142 * @param  pProps               PCM properties to calculate bytes for.
    1142  * @param  cFrames              Amount of audio frames to calculate bytes for.
    1143  */
    1144 uint32_t DrvAudioHlpFramesToBytes(const PPDMAUDIOPCMPROPS pProps, uint32_t cFrames)
     1143 */
     1144uint32_t DrvAudioHlpFramesToBytes(uint32_t cFrames, const PPDMAUDIOPCMPROPS pProps)
    11451145{
    11461146    AssertPtrReturn(pProps, 0);
     
    11561156 *
    11571157 * @return  uint64_t            Calculated time (in ms).
     1158 * @param   cFrames             Amount of audio frames to calculate time for.
    11581159 * @param   pProps              PCM properties to calculate time (in ms) for.
    1159  * @param   cFrames             Amount of audio frames to calculate time for.
    1160  */
    1161 uint64_t DrvAudioHlpFramesToMs(const PPDMAUDIOPCMPROPS pProps, uint32_t cFrames)
     1160 */
     1161uint64_t DrvAudioHlpFramesToMs(uint32_t cFrames, const PPDMAUDIOPCMPROPS pProps)
    11621162{
    11631163    AssertPtrReturn(pProps, 0);
     
    11761176 *
    11771177 * @return  uint32_t            Calculated amount of bytes.
     1178 * @param   uMs                 Time (in ms) to calculate amount of bytes for.
    11781179 * @param   pProps              PCM properties to calculate amount of bytes for.
    1179  * @param   uMs                 Time (in ms) to calculate amount of bytes for.
    1180  */
    1181 uint32_t DrvAudioHlpMsToBytes(const PPDMAUDIOPCMPROPS pProps, uint32_t uMs)
     1180 */
     1181uint32_t DrvAudioHlpMsToBytes(uint32_t uMs, const PPDMAUDIOPCMPROPS pProps)
    11821182{
    11831183    AssertPtrReturn(pProps, 0);
     
    11931193 *
    11941194 * @return  uint32_t            Calculated amount of audio frames.
     1195 * @param   uMs                 Time (in ms) to calculate amount of bytes for.
    11951196 * @param   pProps              PCM properties to calculate amount of bytes for.
    1196  * @param   uMs                 Time (in ms) to calculate amount of bytes for.
    1197  */
    1198 uint32_t DrvAudioHlpMsToFrames(const PPDMAUDIOPCMPROPS pProps, uint32_t uMs)
     1197 */
     1198uint32_t DrvAudioHlpMsToFrames(uint32_t uMs, const PPDMAUDIOPCMPROPS pProps)
    11991199{
    12001200    AssertPtrReturn(pProps, 0);
     
    12041204        return 0;
    12051205
    1206     return DrvAudioHlpMsToBytes(pProps, uMs) / cbFrame;
     1206    return DrvAudioHlpMsToBytes(uMs, pProps) / cbFrame;
    12071207}
    12081208
  • trunk/src/VBox/Devices/Audio/DrvHostALSAAudio.cpp

    r73371 r73380  
    12901290        req.freq        = pCfgReq->Props.uHz;
    12911291        req.nchannels   = pCfgReq->Props.cChannels;
    1292         req.period_size = DrvAudioHlpMsToFrames(&pCfgReq->Props, 50 /* ms */); /** @todo Make this configurable. */
     1292        req.period_size = DrvAudioHlpMsToFrames(50 /* ms */, &pCfgReq->Props); /** @todo Make this configurable. */
    12931293        req.buffer_size = req.period_size * 2; /** @todo Make this configurable. */
    12941294        req.threshold   = req.period_size;
     
    17391739    Log2Func(("cfDelay=%RI32, enmState=%d, rc=%d\n", cfDelay, enmState, rc));
    17401740
    1741     return DrvAudioHlpFramesToBytes(&pStreamALSA->pCfg->Props, cfDelay);
     1741    return DrvAudioHlpFramesToBytes(cfDelay, &pStreamALSA->pCfg->Props);
    17421742}
    17431743
  • trunk/src/VBox/Devices/Audio/DrvHostCoreAudio.cpp

    r73370 r73380  
    12981298        return VERR_GENERAL_FAILURE; /** @todo Fudge! */
    12991299
    1300     const size_t cbBufSize = DrvAudioHlpFramesToBytes(&pCAStream->pCfg->Props, pCAStream->pCfg->Backend.cfPeriod);
     1300    const size_t cbBufSize = DrvAudioHlpFramesToBytes(pCAStream->pCfg->Backend.cfPeriod, &pCAStream->pCfg->Props);
    13011301
    13021302    /*
  • trunk/src/VBox/Devices/Audio/DrvHostDSound.cpp

    r73370 r73380  
    674674         */
    675675        bd.dwFlags       = DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_LOCSOFTWARE;
    676         bd.dwBufferBytes = DrvAudioHlpFramesToBytes(&pCfgReq->Props, pCfgReq->Backend.cfBufferSize);
     676        bd.dwBufferBytes = DrvAudioHlpFramesToBytes(pCfgReq->Backend.cfBufferSize, &pCfgReq->Props);
    677677
    678678        DSLOG(("DSound: Requested playback buffer is %RU64ms (%ld bytes)\n",
    679                pCfgReq->Backend.cfBufferSize, DrvAudioHlpBytesToMs(&pCfgReq->Props, bd.dwBufferBytes), bd.dwBufferBytes));
     679               pCfgReq->Backend.cfBufferSize, DrvAudioHlpBytesToMs(bd.dwBufferBytes, &pCfgReq->Props), bd.dwBufferBytes));
    680680
    681681        hr = IDirectSound8_CreateSoundBuffer(pThis->pDS, &bd, &pDSB, NULL);
     
    719719
    720720        DSLOG(("DSound: Acquired playback buffer is %RU64ms (%ld bytes)\n",
    721                DrvAudioHlpBytesToMs(&pCfgReq->Props, bc.dwBufferBytes), bc.dwBufferBytes));
     721               DrvAudioHlpBytesToMs(bc.dwBufferBytes, &pCfgReq->Props), bc.dwBufferBytes));
    722722
    723723        DSLOG(("DSound: Acquired playback format:\n"
     
    908908
    909909    if (   pStreamDS->Out.fFirstTransfer
    910         && pStreamDS->Out.cbTransferred >= DrvAudioHlpFramesToBytes(&pStreamDS->Cfg.Props, pStreamDS->Cfg.Backend.cfPreBuf))
     910        && pStreamDS->Out.cbTransferred >= DrvAudioHlpFramesToBytes(pStreamDS->Cfg.Backend.cfPreBuf, &pStreamDS->Cfg.Props))
    911911    {
    912912        hr = directSoundPlayStart(pThis, pStreamDS);
     
    12711271        bd.dwSize        = sizeof(bd);
    12721272        bd.lpwfxFormat   = &wfx;
    1273         bd.dwBufferBytes = DrvAudioHlpFramesToBytes(&pCfgReq->Props, pCfgReq->Backend.cfBufferSize);
     1273        bd.dwBufferBytes = DrvAudioHlpFramesToBytes(pCfgReq->Backend.cfBufferSize, &pCfgReq->Props);
    12741274
    12751275        DSLOG(("DSound: Requested capture buffer is %RU64ms (%ld bytes)\n",
    1276                pCfgReq->Backend.cfBufferSize, DrvAudioHlpBytesToMs(&pCfgReq->Props, bd.dwBufferBytes), bd.dwBufferBytes));
     1276               pCfgReq->Backend.cfBufferSize, DrvAudioHlpBytesToMs(bd.dwBufferBytes, &pCfgReq->Props), bd.dwBufferBytes));
    12771277
    12781278        LPDIRECTSOUNDCAPTUREBUFFER pDSCB;
     
    13271327
    13281328        DSLOG(("DSound: Acquired capture buffer is %RU64ms (%ld bytes)\n",
    1329                DrvAudioHlpBytesToMs(&pCfgReq->Props, bc.dwBufferBytes), bc.dwBufferBytes));
     1329               DrvAudioHlpBytesToMs(bc.dwBufferBytes, &pCfgReq->Props), bc.dwBufferBytes));
    13301330
    13311331        DSLOG(("DSound: Capture format:\n"
     
    22102210        {
    22112211            const uint64_t diffLastTransferredMs  = RTTimeMilliTS() - pStreamDS->Out.tsLastTransferred;
    2212             const uint64_t uLastTranserredChunkMs = DrvAudioHlpBytesToMs(&pStreamDS->Cfg.Props, pStreamDS->Out.cbLastTransferred);
     2212            const uint64_t uLastTranserredChunkMs = DrvAudioHlpBytesToMs(pStreamDS->Out.cbLastTransferred, &pStreamDS->Cfg.Props);
    22132213            if (   uLastTranserredChunkMs
    22142214                && diffLastTransferredMs < uLastTranserredChunkMs)
  • trunk/src/VBox/Devices/Audio/DrvHostDebugAudio.cpp

    r73370 r73380  
    121121    if (pCfgAcq)
    122122    {
    123         pCfgAcq->Backend.cfPeriod     = DrvAudioHlpMsToFrames(&pCfgReq->Props, 1000 /* ms */);
     123        pCfgAcq->Backend.cfPeriod     = DrvAudioHlpMsToFrames(1000 /* ms */, &pCfgReq->Props);
    124124        pCfgAcq->Backend.cfBufferSize = pCfgAcq->Backend.cfPeriod * 2; /* Use "double buffering". */
    125125    }
     
    163163        if (pCfgAcq)
    164164        {
    165             pCfgAcq->Backend.cfPeriod     = DrvAudioHlpBytesToFrames(&pCfgReq->Props, 50 /* ms */);
     165            pCfgAcq->Backend.cfPeriod     = DrvAudioHlpBytesToFrames(50 /* ms */, &pCfgReq->Props);
    166166            pCfgAcq->Backend.cfBufferSize = pCfgAcq->Backend.cfPeriod * 2; /* Use "double buffering". */
    167167        }
  • trunk/src/VBox/Devices/Audio/HDAStream.cpp

    r73370 r73380  
    207207
    208208    /* By default we allocate an internal buffer of 100ms. */
    209     rc = RTCircBufCreate(&pStream->State.pCircBuf, DrvAudioHlpMsToBytes(&pCfg->Props, 100 /* ms */)); /** @todo Make this configurable. */
     209    rc = RTCircBufCreate(&pStream->State.pCircBuf, DrvAudioHlpMsToBytes(100 /* ms */, &pCfg->Props)); /** @todo Make this configurable. */
    210210    AssertRCReturn(rc, rc);
    211211
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