VirtualBox

Changeset 73814 in vbox


Ignore:
Timestamp:
Aug 22, 2018 8:40:54 AM (6 years ago)
Author:
vboxsync
Message:

Audio/DrvAudio: Fixes for drvAudioStreamPlay(), drvAudioStreamWrite() and drvAudioStreamGetWritable().

File:
1 edited

Legend:

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

    r73812 r73814  
    871871              ("Stream '%s' is not an output stream and therefore cannot be written to (direction is 0x%x)\n",
    872872               pStream->szName, pStream->enmDir));
    873 
    874     AssertMsg(DrvAudioHlpBytesIsAligned(cbBuf, &pStream->Guest.Cfg.Props),
    875               ("Writing audio data (%RU32 bytes) to stream '%s' is not properly aligned\n", cbBuf, pStream->szName));
    876873
    877874    uint32_t cbWrittenTotal = 0;
     
    14551452        if (fDoPlay)
    14561453        {
    1457             uint32_t cfWritable;
    1458             if (pThis->pHostDrvAudio->pfnStreamGetWritable)
    1459             {
    1460                 cfWritable = PDMAUDIOPCMPROPS_B2F(&pStream->Host.Cfg.Props,
    1461                                                   pThis->pHostDrvAudio->pfnStreamGetWritable(pThis->pHostDrvAudio, pStream->pvBackend));
    1462             }
    1463             else
    1464                 cfWritable = cfPeriod;
     1454            uint32_t cfWritable = PDMAUDIOPCMPROPS_B2F(&pStream->Host.Cfg.Props,
     1455                                                       pThis->pHostDrvAudio->pfnStreamGetWritable(pThis->pHostDrvAudio, pStream->pvBackend));
    14651456
    14661457            uint32_t cfToPlay = 0;
     
    14691460
    14701461            if (!cfToPlay)
    1471                 cfToPlay = cfWritable;
     1462            {
     1463                /* Did we reach/pass (in real time) the device scheduling slot?
     1464                 * Play as much as we can write to the backend then. */
     1465                if (cfPassedReal >= DrvAudioHlpMilliToFrames(pStream->Guest.Cfg.Device.uSchedulingHintMs, &pStream->Host.Cfg.Props))
     1466                    cfToPlay = cfWritable;
     1467            }
    14721468
    14731469            if (cfToPlay > cfLive) /* Don't try to play more than available. */
     
    28002796        cbWritable = AudioMixBufFreeBytes(&pStream->Host.MixBuf);
    28012797
    2802         /* Make sure to align the writable size to the guest's frame size. */
    2803         cbWritable = DrvAudioHlpBytesAlign(cbWritable, &pStream->Guest.Cfg.Props);
     2798        /* Make sure to align the writable size to the host's frame size. */
     2799        cbWritable = DrvAudioHlpBytesAlign(cbWritable, &pStream->Host.Cfg.Props);
    28042800    }
    28052801
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