VirtualBox

Changeset 89376 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 30, 2021 12:16:29 AM (4 years ago)
Author:
vboxsync
Message:

AudioMixBuffer,tstAudioMixBuffer: Fixed copy&paste bug in audioMixBufBlendBuffer, enabled related tests. bugref:9890

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

Legend:

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

    r89373 r89376  
    273273            while (cFrames-- > 0)
    274274            {
    275                 audioMixBufBlendSample(&pi64Dst[0], pi64Dst[0]);
    276                 audioMixBufBlendSample(&pi64Dst[1], pi64Dst[1]);
     275                audioMixBufBlendSample(&pi64Dst[0], pi64Src[0]);
     276                audioMixBufBlendSample(&pi64Dst[1], pi64Src[1]);
    277277                pi64Dst += 2;
    278278                pi64Src += 2;
     
    286286            while (cFrames-- > 0)
    287287            {
    288                 audioMixBufBlendSample(pi64Dst, pi64Dst[0]);
     288                audioMixBufBlendSample(pi64Dst, pi64Src[0]);
    289289                pi64Dst++;
    290290                pi64Src++;
     
    17411741     * First chunk.
    17421742     */
    1743     uint32_t cChunk = RT_MIN(pMixBuf->cFrames - offFrame, cFrames);
    1744     RT_BZERO(&pMixBuf->pFrames[offFrame], cChunk * sizeof(pMixBuf->pFrames[0]));
    1745     cFrames -= cChunk;
     1743    uint32_t const cFramesChunk1 = RT_MIN(pMixBuf->cFrames - offFrame, cFrames);
     1744    RT_BZERO(&pMixBuf->pFrames[offFrame], cFramesChunk1 * sizeof(pMixBuf->pFrames[0]));
    17461745
    17471746    /*
    17481747     * Second chunk, if needed.
    17491748     */
    1750     if (cFrames > 0)
    1751     {
     1749    if (cFrames > cFramesChunk1)
     1750    {
     1751        cFrames -= cFramesChunk1;
    17521752        AssertStmt(cFrames <= pMixBuf->cFrames, cFrames = pMixBuf->cFrames);
    17531753        RT_BZERO(&pMixBuf->pFrames[0], cFrames * sizeof(pMixBuf->pFrames[0]));
  • trunk/src/VBox/Devices/Audio/testcase/tstAudioMixBuffer.cpp

    r89374 r89376  
    469469                    break;
    470470
    471 #if 0 /** @todo doesn't work for some U64 variations */
    472471                case 1: /* zero & blend */
    473472                    AudioMixBufSilence(&MixBuf, &WriteStateIgnZero, 0 /*offFrame*/, cSrcFramesToWrite);
     
    476475                    RTTESTI_CHECK(cFrames == cSrcFramesToWrite);
    477476                    break;
    478 #endif
    479477
    480478                case 2: /* blend same equal data twice */
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