VirtualBox

Ignore:
Timestamp:
Aug 6, 2018 4:26:43 PM (6 years ago)
Author:
vboxsync
Message:

Audio: Changed cBits -> cBytes of PDMAUDIOPCMPROPS to avoid some unnecessary calculations (light optimization).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/DrvAudioVRDE.cpp

    r73464 r73529  
    8787    pCfgAcq->Props.uHz         = 22050; /* The VRDP server's internal frequency. */
    8888    pCfgAcq->Props.cChannels   = 2;
    89     pCfgAcq->Props.cBits       = 16;
     89    pCfgAcq->Props.cBytes      = 2; /* 16 bit. */
    9090    pCfgAcq->Props.fSigned     = true;
    9191    pCfgAcq->Props.fSwapEndian = false;
    92     pCfgAcq->Props.cShift      = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pCfgAcq->Props.cBits, pCfgAcq->Props.cChannels);
     92    pCfgAcq->Props.cShift      = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pCfgAcq->Props.cBytes, pCfgAcq->Props.cChannels);
    9393
    9494    /* According to the VRDP docs, the VRDP server stores audio in 200ms chunks. */
     
    133133        pCfgAcq->Props.uHz       = 22050; /* The VRDP server's internal frequency. */
    134134        pCfgAcq->Props.cChannels = 2;
    135         pCfgAcq->Props.cBits     = 16;
     135        pCfgAcq->Props.cBytes    = 2; /* 16 bit. */
    136136        pCfgAcq->Props.fSigned   = true;
    137         pCfgAcq->Props.cShift    = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pCfgAcq->Props.cBits, pCfgAcq->Props.cChannels);
     137        pCfgAcq->Props.cShift    = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pCfgAcq->Props.cBytes, pCfgAcq->Props.cChannels);
    138138
    139139        /* According to the VRDP docs, the VRDP server stores audio in 200ms chunks. */
     
    174174                                                               DrvAudioHlpMilliToFrames(200 /* ms */, &pStreamVRDE->pCfg->Props),
    175175                                                               pStreamVRDE->pCfg->Props.uHz, pStreamVRDE->pCfg->Props.cChannels,
    176                                                                pStreamVRDE->pCfg->Props.cBits);
     176                                                               pStreamVRDE->pCfg->Props.cBytes * 8 /* Bit */);
    177177            if (rc == VERR_NOT_SUPPORTED)
    178178            {
     
    291291    VRDEAUDIOFORMAT format = VRDE_AUDIO_FMT_MAKE(pProps->uHz,
    292292                                                 pProps->cChannels,
    293                                                  pProps->cBits,
     293                                                 pProps->cBytes * 8 /* Bit */,
    294294                                                 pProps->fSigned);
    295295
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