VirtualBox

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


Ignore:
Timestamp:
Nov 11, 2021 4:30:13 PM (3 years ago)
Author:
vboxsync
Message:

Audio/Validation Kit: Check for silent blocks in audioTestFilesFindDiffsBinary(). bugref:10008

File:
1 edited

Legend:

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

    r92337 r92378  
    22842284        AssertBreakStmt(cbReadA == cbReadB, rc = VERR_INVALID_PARAMETER); /** @todo Find a better rc. */
    22852285
    2286         if (memcmp(auBufA, auBufB, RT_MIN(cbReadA, cbReadB)) != 0)
     2286        const size_t cbToCmp = RT_MIN(cbReadA, cbReadB);
     2287        if (memcmp(auBufA, auBufB, cbToCmp) != 0)
    22872288        {
    22882289            if (!fInDiff) /* No consequitive different chunk? Count as new then. */
     
    22972298            if (fInDiff)
    22982299            {
     2300                bool const fIsAllSilenceA = PDMAudioPropsIsBufferSilence(&pToneParms->Props, auBufA, cbToCmp);
     2301                bool const fIsAllSilenceB = PDMAudioPropsIsBufferSilence(&pToneParms->Props, auBufB, cbToCmp);
     2302
    22992303                uint32_t const cbDiff = offCur - offDiffStart;
    2300                 int rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "Chunks differ: A @ %#x vs. B @ %#x [%08RU64-%08RU64] (%RU64 bytes, %RU64ms)",
    2301                                                                                      pCmpA->offStart, pCmpB->offStart, offDiffStart, offCur,
     2304                int rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "Chunks differ: A @ %#x [%08RU64-%08RU64] vs. B @ %#x [%08RU64-%08RU64] (%RU64 bytes, %RU64ms)",
     2305                                                                                     pCmpA->offStart + offDiffStart, pCmpA->offStart + offDiffStart, pCmpA->offStart + offCur,
     2306                                                                                     pCmpB->offStart + offDiffStart, pCmpB->offStart + offDiffStart, pCmpB->offStart + offCur,
    23022307                                                                                     cbDiff, PDMAudioPropsBytesToMilli(&pToneParms->Props, cbDiff));
    23032308                AssertRC(rc2);
     2309                if (   fIsAllSilenceA
     2310                    || fIsAllSilenceB)
     2311                {
     2312                    rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "Chunk %s @ %#x (%RU64 bytes, %RU64ms) is all silence",
     2313                                                                                     fIsAllSilenceA ? "A" : "B",
     2314                                                                                     offDiffStart, cbDiff, PDMAudioPropsBytesToMilli(&pToneParms->Props, cbDiff));
     2315                    AssertRC(rc2);
     2316                }
    23042317
    23052318                cbDiffs += cbDiff;
     
    23172330    {
    23182331        uint32_t const cbDiff = offCur - offDiffStart;
    2319         int rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "Chunks differ: A @ %#x vs. B @ %#x [%08RU64-%08RU64] (%RU64 bytes, %RU64ms)",
    2320                                                                              pCmpA->offStart, pCmpB->offStart, offDiffStart, offCur,
     2332        int rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "Chunks differ: A @ %#x [%08RU64-%08RU64] vs. B @ %#x [%08RU64-%08RU64] (%RU64 bytes, %RU64ms)",
     2333                                                                             pCmpA->offStart + offDiffStart, pCmpA->offStart + offDiffStart, pCmpA->offStart + offCur,
     2334                                                                             pCmpB->offStart + offDiffStart, pCmpB->offStart + offDiffStart, pCmpB->offStart + offCur,
    23212335                                                                             cbDiff, PDMAudioPropsBytesToMilli(&pToneParms->Props, cbDiff));
    23222336        AssertRC(rc2);
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