VirtualBox

Ignore:
Timestamp:
Mar 8, 2021 12:08:34 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
143129
Message:

Audio: DrvAudioHlpBytesAlign -> DrvAudioHlpFloorBytesToFrame as it isn't doing an align operation similar to RT_ALIGN, it's rounding down rather than up. Switched parameters and tweaked the implementation slightly. bugref:9890

File:
1 edited

Legend:

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

    r88004 r88006  
    7272                      ("got %x, expected 4\n", PDMAUDIOPCMPROPS_F2B(&s_Cfg441StereoU32, 1)));
    7373
     74    uint32_t u32;
    7475    for (uint32_t i = 0; i < 256; i += 8)
    7576    {
    7677        RTTESTI_CHECK(DrvAudioHlpIsBytesAligned(&s_Cfg441StereoU32, i) == true);
    77         RTTESTI_CHECK(DrvAudioHlpIsBytesAligned(&s_Cfg441StereoU32, i+1) == false);
    78         RTTESTI_CHECK(DrvAudioHlpIsBytesAligned(&s_Cfg441StereoU32, i+2) == false);
    79         RTTESTI_CHECK(DrvAudioHlpIsBytesAligned(&s_Cfg441StereoU32, i+3) == false);
    80         RTTESTI_CHECK(DrvAudioHlpIsBytesAligned(&s_Cfg441StereoU32, i+4) == false);
    81         RTTESTI_CHECK(DrvAudioHlpIsBytesAligned(&s_Cfg441StereoU32, i+5) == false);
    82         RTTESTI_CHECK(DrvAudioHlpIsBytesAligned(&s_Cfg441StereoU32, i+6) == false);
    83         RTTESTI_CHECK(DrvAudioHlpIsBytesAligned(&s_Cfg441StereoU32, i+7) == false);
     78        for (uint32_t j = 1; j < 8; j++)
     79            RTTESTI_CHECK(DrvAudioHlpIsBytesAligned(&s_Cfg441StereoU32, i + j) == false);
     80        for (uint32_t j = 0; j < 8; j++)
     81            RTTESTI_CHECK(DrvAudioHlpFloorBytesToFrame(&s_Cfg441StereoU32, i + j) == i);
    8482    }
    8583    for (uint32_t i = 0; i < 4096; i += 4)
    8684    {
    8785        RTTESTI_CHECK(DrvAudioHlpIsBytesAligned(&s_Cfg441StereoS16, i) == true);
    88         RTTESTI_CHECK(DrvAudioHlpIsBytesAligned(&s_Cfg441StereoS16, i+1) == false);
    89         RTTESTI_CHECK(DrvAudioHlpIsBytesAligned(&s_Cfg441StereoS16, i+2) == false);
    90         RTTESTI_CHECK(DrvAudioHlpIsBytesAligned(&s_Cfg441StereoS16, i+3) == false);
    91     }
    92 
    93     uint32_t u32;
     86        for (uint32_t j = 1; j < 4; j++)
     87            RTTESTI_CHECK(DrvAudioHlpIsBytesAligned(&s_Cfg441StereoS16, i + j) == false);
     88        for (uint32_t j = 0; j < 4; j++)
     89            RTTESTI_CHECK(DrvAudioHlpFloorBytesToFrame(&s_Cfg441StereoS16, i + j) == i);
     90    }
     91
    9492    RTTESTI_CHECK_MSG((u32 = DrvAudioHlpFramesToBytes(&s_Cfg441StereoS16, 44100)) == 44100 * 2 * 2,
    9593                      ("cb=%RU32\n", u32));
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette