VirtualBox

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


Ignore:
Timestamp:
Feb 7, 2017 12:51:46 PM (8 years ago)
Author:
vboxsync
Message:

Audio/DrvHostNullAudio.cpp: Remove not-used stuff.

File:
1 edited

Legend:

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

    r65624 r65655  
    6464    /** The stream's acquired configuration. */
    6565    PPDMAUDIOSTREAMCFG pCfg;
    66     union
    67     {
    68         struct
    69         {
    70             /** Timestamp of last played samples. */
    71             uint64_t   u64TicksLast;
    72         } Out;
    73     };
    74 } NULLAUDIOSTREAM;
    75 typedef NULLAUDIOSTREAM *PNULLAUDIOSTREAM;
     66} NULLAUDIOSTREAM, *PNULLAUDIOSTREAM;
    7667
    7768/**
     
    151142    AssertReturn(cbBuf,         VERR_INVALID_PARAMETER);
    152143
    153     PDRVHOSTNULLAUDIO pDrv        = RT_FROM_MEMBER(pInterface, DRVHOSTNULLAUDIO, IHostAudio);
    154     PNULLAUDIOSTREAM  pStreamNull = (PNULLAUDIOSTREAM)pStream;
    155 
    156     /* Consume as many samples as would be played at the current frequency since last call. */
    157     uint32_t csLive          = PDMAUDIOPCMPROPS_B2S(&pStreamNull->pCfg->Props, cbBuf);
    158 
    159     uint64_t u64TicksNow     = PDMDrvHlpTMGetVirtualTime(pDrv->pDrvIns);
    160     uint64_t u64TicksElapsed = u64TicksNow  - pStreamNull->Out.u64TicksLast;
    161     uint64_t u64TicksFreq    = PDMDrvHlpTMGetVirtualFreq(pDrv->pDrvIns);
    162 
    163     /* Remember when samples were consumed. */
    164     pStreamNull->Out.u64TicksLast = u64TicksNow;
    165 
    166     /*
    167      * Minimize the rounding error by adding 0.5: samples = int((u64TicksElapsed * samplesFreq) / u64TicksFreq + 0.5).
    168      * If rounding is not taken into account then the playback rate will be consistently lower that expected.
    169      */
    170     uint64_t csPlayed = (2 * u64TicksElapsed * pStreamNull->pCfg->Props.uHz + u64TicksFreq) / u64TicksFreq / 2;
    171 
    172     /* Don't play more than available. */
    173     if (csPlayed > csLive)
    174         csPlayed = csLive;
     144    RT_NOREF(pInterface, pStream, pvBuf);
    175145
    176146    /* Note: No copying of samples needed here, as this a NULL backend. */
    177147
    178148    if (pcbWritten)
    179         *pcbWritten = PDMAUDIOPCMPROPS_S2B(&pStreamNull->pCfg->Props, csPlayed);
     149        *pcbWritten = cbBuf; /* Return all bytes as written. */
    180150
    181151    return VINF_SUCCESS;
     
    214184static int nullCreateStreamOut(PNULLAUDIOSTREAM pStreamNull, PPDMAUDIOSTREAMCFG pCfgReq, PPDMAUDIOSTREAMCFG pCfgAcq)
    215185{
    216     RT_NOREF(pCfgReq);
    217 
    218     pStreamNull->Out.u64TicksLast  = 0;
     186    RT_NOREF(pStreamNull, pCfgReq);
    219187
    220188    if (pCfgAcq)
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