VirtualBox

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


Ignore:
Timestamp:
Jul 18, 2018 3:23:11 PM (7 years ago)
Author:
vboxsync
Message:

Audio/HDA: Made the stream's internal ring buffer size depend on a time frame instead of a fixed (byte) value, as the final size will depend on the stream's Hz rate.

File:
1 edited

Legend:

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

    r71736 r73212  
    6565    AssertRCReturn(rc, rc);
    6666
    67     rc = RTCircBufCreate(&pStream->State.pCircBuf, _64K); /** @todo Make this configurable. */
    68     AssertRCReturn(rc, rc);
    69 
    7067    rc = hdaR3StreamPeriodCreate(&pStream->State.Period);
    7168    AssertRCReturn(rc, rc);
     
    197194        return rc;
    198195    }
     196
     197    /* (Re-)Allocate the stream's internal DMA buffer, based on the PCM  properties we just got above. */
     198    if (pStream->State.pCircBuf)
     199    {
     200        RTCircBufDestroy(pStream->State.pCircBuf);
     201        pStream->State.pCircBuf = NULL;
     202    }
     203
     204    /* By default we allocate an internal buffer of 100ms. */
     205    rc = RTCircBufCreate(&pStream->State.pCircBuf, DrvAudioHlpMsToBytes(&pCfg->Props, 100 /* ms */)); /** @todo Make this configurable. */
     206    AssertRCReturn(rc, rc);
    199207
    200208    /* Set the stream's direction. */
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