VirtualBox

Changeset 89747 in vbox for trunk/src/VBox/Devices/Audio


Ignore:
Timestamp:
Jun 16, 2021 4:06:15 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
145198
Message:

Audio/ValKit: Implemented first first (primitive) binary PCM data comparison. bugref:10008

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

Legend:

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

    r89711 r89747  
    2626
    2727#include <iprt/buildconfig.h>
     28#include <iprt/cdefs.h>
    2829#include <iprt/dir.h>
    2930#include <iprt/env.h>
     
    3435#include <iprt/message.h> /** @todo Get rid of this once we have own log hooks. */
    3536#include <iprt/rand.h>
     37#include <iprt/stream.h>
    3638#include <iprt/system.h>
    3739#include <iprt/uuid.h>
     
    6769*   Structures and Typedefs                                                                                                      *
    6870*********************************************************************************************************************************/
     71/**
     72 * Structure for an internal object handle.
     73 *
     74 * As we only support .INI-style files for now, this only has the object's section name in it.
     75 */
     76typedef struct AUDIOTESTOBJHANDLE
     77{
     78    char szSec[128];
     79} AUDIOTESTOBJHANDLE;
     80/** Pointer to an audio test object handle. */
     81typedef AUDIOTESTOBJHANDLE* PAUDIOTESTOBJHANDLE;
     82
    6983/**
    7084 * Structure for keeping an audio test verification job.
     
    86100typedef AUDIOTESTVERIFYJOB *PAUDIOTESTVERIFYJOB;
    87101
     102
     103/*********************************************************************************************************************************
     104*   Prototypes                                                                                                                   *
     105*********************************************************************************************************************************/
     106static int audioTestSetObjCloseInternal(PAUDIOTESTOBJ pObj);
     107static void audioTestSetObjFinalize(PAUDIOTESTOBJ pObj);
    88108
    89109/*********************************************************************************************************************************
     
    803823    RTListForEachSafe(&pSet->lstObj, pObj, pObjNext, AUDIOTESTOBJ, Node)
    804824    {
    805         rc = AudioTestSetObjClose(pObj);
     825        rc = audioTestSetObjCloseInternal(pObj);
    806826        if (RT_SUCCESS(rc))
    807827        {
     
    881901    rc = RTIniFileCreateFromVfsFile(&pSet->f.hIniFile, hVfsFile, RTINIFILE_F_READONLY);
    882902    RTVfsFileRelease(hVfsFile);
     903    AssertRCReturn(rc, rc);
     904
     905    rc = RTStrCopy(pSet->szPathAbs, sizeof(pSet->szPathAbs), pszPath);
    883906    AssertRCReturn(rc, rc);
    884907
     
    10091032    RTListForEach(&pSet->lstObj, pObj, AUDIOTESTOBJ, Node)
    10101033    {
    1011         int rc2 = AudioTestSetObjClose(pObj);
     1034        int rc2 = audioTestSetObjCloseInternal(pObj);
    10121035        if (RT_SUCCESS(rc2))
    10131036        {
     
    11661189        return VINF_SUCCESS;
    11671190
    1168     /** @todo Generalize this function more once we have more object types. */
    1169     AssertReturn(pObj->enmType == AUDIOTESTOBJTYPE_FILE, VERR_INVALID_PARAMETER);
    1170 
    1171     int rc = VINF_SUCCESS;
    1172 
    1173     if (RTFileIsValid(pObj->File.hFile))
    1174     {
    1175         pObj->File.cbSize = RTFileTell(pObj->File.hFile);
    1176 
    1177         rc = RTFileClose(pObj->File.hFile);
    1178         pObj->File.hFile = NIL_RTFILE;
    1179     }
    1180 
    1181     return rc;
     1191    audioTestSetObjFinalize(pObj);
     1192
     1193    return audioTestSetObjCloseInternal(pObj);
    11821194}
    11831195
     
    14231435 * @returns VBox status code.
    14241436 * @param   pSet                Test set to get value from.
    1425  * @param   pszSec              Section to get value from.
     1437 * @param   phObj               Object handle to get value for.
    14261438 * @param   pszKey              Key to get value from.
    14271439 * @param   pszVal              Where to return the value on success.
     
    14291441 */
    14301442static int audioTestGetValueStr(PAUDIOTESTSET pSet,
    1431                                 const char *pszSec, const char *pszKey, char *pszVal, size_t cbVal)
    1432 {
    1433     return RTIniFileQueryValue(pSet->f.hIniFile, pszSec, pszKey, pszVal, cbVal, NULL);
     1443                                PAUDIOTESTOBJHANDLE phObj, const char *pszKey, char *pszVal, size_t cbVal)
     1444{
     1445    return RTIniFileQueryValue(pSet->f.hIniFile, phObj->szSec, pszKey, pszVal, cbVal, NULL);
    14341446}
    14351447
     
    14391451 * @returns VBox status code.
    14401452 * @param   pSet                Test set to get value from.
    1441  * @param   pszSec              Section to get value from.
     1453 * @param   phObj               Object handle to get value for.
    14421454 * @param   pszKey              Key to get value from.
    14431455 * @param   puVal               Where to return the value on success.
    14441456 */
    14451457static int audioTestGetValueUInt32(PAUDIOTESTSET pSet,
    1446                                    const char *pszSec, const char *pszKey, uint32_t *puVal)
     1458                                   PAUDIOTESTOBJHANDLE phObj, const char *pszKey, uint32_t *puVal)
    14471459{
    14481460    char szVal[_1K];
    1449     int rc = audioTestGetValueStr(pSet, pszSec, pszKey, szVal, sizeof(szVal));
     1461    int rc = audioTestGetValueStr(pSet, phObj, pszKey, szVal, sizeof(szVal));
    14501462    if (RT_SUCCESS(rc))
    14511463        *puVal = RTStrToUInt32(szVal);
     
    14601472 * @returns Error if the verification failed and test verification job has fKeepGoing not set.
    14611473 * @param   pVerify             Verification job to verify value for.
    1462  * @param   pszSec              Section of key / value to verify.
     1474 * @param   phObj               Object handle to verify value for.
    14631475 * @param   pszKey              Key to verify.
    14641476 * @param   pszVal              Value to verify.
     
    14671479 */
    14681480static int audioTestVerifyValue(PAUDIOTESTVERIFYJOB pVerify,
    1469                                 const char *pszSec, const char *pszKey, const char *pszVal, const char *pszErrFmt, ...)
     1481                                PAUDIOTESTOBJHANDLE phObj, const char *pszKey, const char *pszVal, const char *pszErrFmt, ...)
    14701482{
    14711483    va_list va;
     
    14731485
    14741486    char szValA[_1K];
    1475     int rc = audioTestGetValueStr(pVerify->pSetA, pszSec, pszKey, szValA, sizeof(szValA));
     1487    int rc = audioTestGetValueStr(pVerify->pSetA, phObj, pszKey, szValA, sizeof(szValA));
    14761488    if (RT_SUCCESS(rc))
    14771489    {
    14781490        char szValB[_1K];
    1479         rc = audioTestGetValueStr(pVerify->pSetB, pszSec, pszKey, szValB, sizeof(szValB));
     1491        rc = audioTestGetValueStr(pVerify->pSetB, phObj, pszKey, szValB, sizeof(szValB));
    14801492        if (RT_SUCCESS(rc))
    14811493        {
     
    15031515
    15041516/**
     1517 * Opens an existing audio test object.
     1518 *
     1519 * @returns VBox status code.
     1520 * @param   pSet                Audio test set the object contains.
     1521 * @param   pszUUID             UUID of object to open.
     1522 * @param   ppObj               Where to return the pointer of the allocated and registered audio test object.
     1523 */
     1524static int audioTestSetObjOpen(PAUDIOTESTSET pSet, const char *pszUUID, PAUDIOTESTOBJ *ppObj)
     1525{
     1526    AUDIOTESTOBJHANDLE hSec;
     1527    if (RTStrPrintf2(hSec.szSec, sizeof(hSec.szSec), "obj_%s", pszUUID) <= 0)
     1528        AssertFailedReturn(VERR_BUFFER_OVERFLOW);
     1529
     1530    PAUDIOTESTOBJ pObj = (PAUDIOTESTOBJ)RTMemAlloc(sizeof(AUDIOTESTOBJ));
     1531    AssertPtrReturn(pObj, VERR_NO_MEMORY);
     1532
     1533    char szFileName[128];
     1534    int rc = audioTestGetValueStr(pSet, &hSec, "obj_name", szFileName, sizeof(szFileName));
     1535    if (RT_SUCCESS(rc))
     1536    {
     1537        char szFilePath[RTPATH_MAX];
     1538        rc = RTPathJoin(szFilePath, sizeof(szFilePath), pSet->szPathAbs, szFileName);
     1539        if (RT_SUCCESS(rc))
     1540        {
     1541            rc = RTFileOpen(&pObj->File.hFile, szFilePath, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE);
     1542            if (RT_SUCCESS(rc))
     1543            {
     1544                int rc2 = RTStrCopy(pObj->szName, sizeof(pObj->szName), szFileName);
     1545                AssertRC(rc2);
     1546
     1547                pObj->enmType = AUDIOTESTOBJTYPE_FILE;
     1548                pObj->cRefs   = 1; /* Currently only 1:1 mapping. */
     1549
     1550                RTListAppend(&pSet->lstObj, &pObj->Node);
     1551                pSet->cObj++;
     1552
     1553                *ppObj = pObj;
     1554                return VINF_SUCCESS;
     1555            }
     1556        }
     1557    }
     1558
     1559    RTMemFree(pObj);
     1560    return rc;
     1561}
     1562
     1563/**
     1564 * Closes an audio test set object.
     1565 *
     1566 * @returns VBox status code.
     1567 * @param   pObj                Object to close.
     1568 */
     1569static int audioTestSetObjCloseInternal(PAUDIOTESTOBJ pObj)
     1570{
     1571    int rc;
     1572
     1573    /** @todo Generalize this function more once we have more object types. */
     1574    AssertReturn(pObj->enmType == AUDIOTESTOBJTYPE_FILE, VERR_INVALID_PARAMETER);
     1575
     1576    if (RTFileIsValid(pObj->File.hFile))
     1577    {
     1578        rc = RTFileClose(pObj->File.hFile);
     1579        if (RT_SUCCESS(rc))
     1580            pObj->File.hFile = NIL_RTFILE;
     1581    }
     1582    else
     1583        rc = VINF_SUCCESS;
     1584
     1585    return rc;
     1586}
     1587
     1588/**
     1589 * Finalizes an audio test set object.
     1590 *
     1591 * @param   pObj                Object to finalize.
     1592 */
     1593static void audioTestSetObjFinalize(PAUDIOTESTOBJ pObj)
     1594{
     1595    /** @todo Generalize this function more once we have more object types. */
     1596    AssertReturnVoid(pObj->enmType == AUDIOTESTOBJTYPE_FILE);
     1597
     1598    if (RTFileIsValid(pObj->File.hFile))
     1599        pObj->File.cbSize = RTFileTell(pObj->File.hFile);
     1600}
     1601
     1602/**
     1603 * Compares two (binary) files.
     1604 *
     1605 * @returns \c true if equal, or \c false if not.
     1606 * @param   hFileA              File handle to file A to compare.
     1607 * @param   hFileB              File handle to file B to compare file A with.
     1608 * @param   cbToCompare         Number of bytes to compare starting the the both file's
     1609 *                              current position.
     1610 */
     1611static bool audioTestFilesCompareBinary(RTFILE hFileA, RTFILE hFileB, uint64_t cbToCompare)
     1612{
     1613    uint8_t auBufA[_32K];
     1614    uint8_t auBufB[_32K];
     1615
     1616    int rc = VINF_SUCCESS;
     1617
     1618    while (cbToCompare)
     1619    {
     1620        size_t cbReadA;
     1621        rc = RTFileRead(hFileA, auBufA, RT_MIN(cbToCompare, sizeof(auBufA)), &cbReadA);
     1622        AssertRCBreak(rc);
     1623        size_t cbReadB;
     1624        rc = RTFileRead(hFileB, auBufB, RT_MIN(cbToCompare, sizeof(auBufB)), &cbReadB);
     1625        AssertRCBreak(rc);
     1626        AssertBreakStmt(cbReadA == cbReadB, rc = VERR_INVALID_PARAMETER); /** @todo Find a better rc. */
     1627        if (memcmp(auBufA, auBufB, RT_MIN(cbReadA, cbReadB)) != 0)
     1628            return false;
     1629        Assert(cbToCompare >= cbReadA);
     1630        cbToCompare -= cbReadA;
     1631    }
     1632
     1633    return RT_SUCCESS(rc) && (cbToCompare == 0);
     1634}
     1635
     1636/**
     1637 * Does the actual PCM data verification of a test tone.
     1638 *
     1639 * @returns VBox status code.
     1640 * @param   pVerify             Verification job to verify PCM data for.
     1641 * @param   phTest              Test handle of test to verify PCM data for.
     1642 */
     1643static int audioTestVerifyTestToneData(PAUDIOTESTVERIFYJOB pVerify, PAUDIOTESTOBJHANDLE phTest)
     1644{
     1645    int rc;
     1646
     1647    /** @todo For now ASSUME that we only have one object per test. */
     1648
     1649    char szObjA[128];
     1650    rc = audioTestGetValueStr(pVerify->pSetA, phTest, "obj0_uuid", szObjA, sizeof(szObjA));
     1651    AssertRCReturn(rc, rc);
     1652    PAUDIOTESTOBJ pObjA;
     1653    rc = audioTestSetObjOpen(pVerify->pSetA, szObjA, &pObjA);
     1654    AssertRCReturn(rc, rc);
     1655
     1656    char szObjB[128];
     1657    rc = audioTestGetValueStr(pVerify->pSetB, phTest, "obj0_uuid", szObjB, sizeof(szObjB));
     1658    AssertRCReturn(rc, rc);
     1659    PAUDIOTESTOBJ pObjB;
     1660    rc = audioTestSetObjOpen(pVerify->pSetB, szObjB, &pObjB);
     1661    AssertRCReturn(rc, rc);
     1662
     1663    AssertReturn(pObjA->enmType == AUDIOTESTOBJTYPE_FILE, VERR_NOT_SUPPORTED);
     1664    AssertReturn(pObjB->enmType == AUDIOTESTOBJTYPE_FILE, VERR_NOT_SUPPORTED);
     1665
     1666    /*
     1667     * Start with most obvious methods first.
     1668     */
     1669    uint64_t cbSizeA, cbSizeB;
     1670    rc = RTFileQuerySize(pObjA->File.hFile, &cbSizeA);
     1671    AssertRCReturn(rc, rc);
     1672    rc = RTFileQuerySize(pObjB->File.hFile, &cbSizeB);
     1673    AssertRCReturn(rc, rc);
     1674    if (   cbSizeA != cbSizeB
     1675        || !audioTestFilesCompareBinary(pObjA->File.hFile, pObjB->File.hFile, cbSizeA))
     1676    {
     1677        /** @todo Add more sophisticated stuff here. */
     1678
     1679        int rc2 = audioTestErrorDescAdd(pVerify->pErr, pVerify->idxTest, "Files '%s' and '%s' don't match\n", szObjA, szObjB);
     1680        AssertRC(rc2);
     1681    }
     1682
     1683    rc = audioTestSetObjCloseInternal(pObjA);
     1684    AssertRCReturn(rc, rc);
     1685    rc = audioTestSetObjCloseInternal(pObjB);
     1686    AssertRCReturn(rc, rc);
     1687
     1688    return rc;
     1689}
     1690
     1691/**
    15051692 * Verifies a test tone test.
    15061693 *
     
    15091696 * @retval  VERR_
    15101697 * @param   pVerify             Verification job to verify test tone for.
    1511  * @param   pszSec              Section of test tone to verify.
     1698 * @param   phTest              Test handle of test tone to verify.
    15121699 * @param   pSetPlay            Test set which did the playing part.
    15131700 * @param   pSetRecord          Test set which did the recording part.
    15141701 */
    1515 static int audioTestVerifyTestTone(PAUDIOTESTVERIFYJOB pVerify, const char *pszSec, PAUDIOTESTSET pSetPlay, PAUDIOTESTSET pSetRecord)
     1702static int audioTestVerifyTestTone(PAUDIOTESTVERIFYJOB pVerify, PAUDIOTESTOBJHANDLE phTest, PAUDIOTESTSET pSetPlay, PAUDIOTESTSET pSetRecord)
    15161703{
    15171704    RT_NOREF(pSetPlay, pSetRecord);
     
    15231710     * More important items have precedence.
    15241711     */
    1525     rc = audioTestVerifyValue(pVerify, pszSec, "error_rc", "0", "Test was reported as failed");
    1526     AssertRCReturn(rc, rc);
    1527     rc = audioTestVerifyValue(pVerify, pszSec, "obj_count", NULL, "Object counts don't match");
    1528     AssertRCReturn(rc, rc);
    1529     rc = audioTestVerifyValue(pVerify, pszSec, "tone_freq_hz", NULL, "Tone frequency doesn't match");
    1530     AssertRCReturn(rc, rc);
    1531     rc = audioTestVerifyValue(pVerify, pszSec, "tone_prequel_ms", NULL, "Tone prequel (ms) doesn't match");
    1532     AssertRCReturn(rc, rc);
    1533     rc = audioTestVerifyValue(pVerify, pszSec, "tone_duration_ms", NULL, "Tone duration (ms) doesn't match");
    1534     AssertRCReturn(rc, rc);
    1535     rc = audioTestVerifyValue(pVerify, pszSec, "tone_sequel_ms", NULL, "Tone sequel (ms) doesn't match");
    1536     AssertRCReturn(rc, rc);
    1537     rc = audioTestVerifyValue(pVerify, pszSec, "tone_volume_percent", NULL, "Tone volume (percent) doesn't match");
    1538     AssertRCReturn(rc, rc);
    1539     rc = audioTestVerifyValue(pVerify, pszSec, "tone_pcm_hz", NULL, "Tone PCM Hz doesn't match");
    1540     AssertRCReturn(rc, rc);
    1541     rc = audioTestVerifyValue(pVerify, pszSec, "tone_pcm_channels", NULL, "Tone PCM channels don't match");
    1542     AssertRCReturn(rc, rc);
    1543     rc = audioTestVerifyValue(pVerify, pszSec, "tone_pcm_bits", NULL, "Tone PCM bits don't match");
    1544     AssertRCReturn(rc, rc);
    1545     rc = audioTestVerifyValue(pVerify, pszSec, "tone_pcm_is_signed", NULL, "Tone PCM signed bit doesn't match");
    1546     AssertRCReturn(rc, rc);
     1712    rc = audioTestVerifyValue(pVerify, phTest, "error_rc", "0", "Test was reported as failed");
     1713    AssertRCReturn(rc, rc);
     1714    rc = audioTestVerifyValue(pVerify, phTest, "obj_count", NULL, "Object counts don't match");
     1715    AssertRCReturn(rc, rc);
     1716    rc = audioTestVerifyValue(pVerify, phTest, "tone_freq_hz", NULL, "Tone frequency doesn't match");
     1717    AssertRCReturn(rc, rc);
     1718    rc = audioTestVerifyValue(pVerify, phTest, "tone_prequel_ms", NULL, "Tone prequel (ms) doesn't match");
     1719    AssertRCReturn(rc, rc);
     1720    rc = audioTestVerifyValue(pVerify, phTest, "tone_duration_ms", NULL, "Tone duration (ms) doesn't match");
     1721    AssertRCReturn(rc, rc);
     1722    rc = audioTestVerifyValue(pVerify, phTest, "tone_sequel_ms", NULL, "Tone sequel (ms) doesn't match");
     1723    AssertRCReturn(rc, rc);
     1724    rc = audioTestVerifyValue(pVerify, phTest, "tone_volume_percent", NULL, "Tone volume (percent) doesn't match");
     1725    AssertRCReturn(rc, rc);
     1726    rc = audioTestVerifyValue(pVerify, phTest, "tone_pcm_hz", NULL, "Tone PCM Hz doesn't match");
     1727    AssertRCReturn(rc, rc);
     1728    rc = audioTestVerifyValue(pVerify, phTest, "tone_pcm_channels", NULL, "Tone PCM channels don't match");
     1729    AssertRCReturn(rc, rc);
     1730    rc = audioTestVerifyValue(pVerify, phTest, "tone_pcm_bits", NULL, "Tone PCM bits don't match");
     1731    AssertRCReturn(rc, rc);
     1732    rc = audioTestVerifyValue(pVerify, phTest, "tone_pcm_is_signed", NULL, "Tone PCM signed bit doesn't match");
     1733    AssertRCReturn(rc, rc);
     1734
     1735    /*
     1736     * Now the fun stuff, PCM data analysis.
     1737     */
     1738    rc = audioTestVerifyTestToneData(pVerify, phTest);
     1739    if (RT_FAILURE(rc))
     1740    {
     1741       int rc2 = audioTestErrorDescAdd(pVerify->pErr, pVerify->idxTest, "Verififcation of test tone data failed\n");
     1742       AssertRC(rc2);
     1743    }
    15471744
    15481745    return VINF_SUCCESS;
     
    15801777     * Compare obvious values first.
    15811778     */
    1582     rc = audioTestVerifyValue(&VerJob, "header",   "magic",        "vkat_ini",    "Manifest magic wrong");
    1583     AssertRCReturn(rc, rc);
    1584     rc = audioTestVerifyValue(&VerJob, "header",   "ver",          "1"       ,    "Manifest version wrong");
    1585     AssertRCReturn(rc, rc);
    1586     rc = audioTestVerifyValue(&VerJob, "header",   "tag",          NULL,          "Manifest tags don't match");
    1587     AssertRCReturn(rc, rc);
    1588     rc = audioTestVerifyValue(&VerJob, "header",   "test_count",   NULL,          "Test counts don't match");
    1589     AssertRCReturn(rc, rc);
    1590     rc = audioTestVerifyValue(&VerJob, "header",   "obj_count",    NULL,          "Object counts don't match");
     1779    AUDIOTESTOBJHANDLE hHdr;
     1780    RTStrPrintf(hHdr.szSec, sizeof(hHdr.szSec), "header");
     1781
     1782    rc = audioTestVerifyValue(&VerJob, &hHdr,   "magic",        "vkat_ini",    "Manifest magic wrong");
     1783    AssertRCReturn(rc, rc);
     1784    rc = audioTestVerifyValue(&VerJob, &hHdr,   "ver",          "1"       ,    "Manifest version wrong");
     1785    AssertRCReturn(rc, rc);
     1786    rc = audioTestVerifyValue(&VerJob, &hHdr,   "tag",          NULL,          "Manifest tags don't match");
     1787    AssertRCReturn(rc, rc);
     1788    rc = audioTestVerifyValue(&VerJob, &hHdr,   "test_count",   NULL,          "Test counts don't match");
     1789    AssertRCReturn(rc, rc);
     1790    rc = audioTestVerifyValue(&VerJob, &hHdr,   "obj_count",    NULL,          "Object counts don't match");
    15911791    AssertRCReturn(rc, rc);
    15921792
     
    15991799     */
    16001800    uint32_t cTests;
    1601     rc = audioTestGetValueUInt32(VerJob.pSetA, "header", "test_count", &cTests);
     1801    rc = audioTestGetValueUInt32(VerJob.pSetA, &hHdr, "test_count", &cTests);
    16021802    AssertRCReturn(rc, rc);
    16031803
     
    16061806        VerJob.idxTest = i;
    16071807
    1608         char szSec[64];
    1609         RTStrPrintf(szSec, sizeof(szSec), "test_%04RU32", i);
     1808        AUDIOTESTOBJHANDLE hTest;
     1809        RTStrPrintf(hTest.szSec, sizeof(hTest.szSec), "test_%04RU32", i);
    16101810
    16111811        AUDIOTESTTYPE enmTestTypeA;
    1612         audioTestGetValueUInt32(VerJob.pSetA, szSec, "test_type", (uint32_t *)&enmTestTypeA);
     1812        rc = audioTestGetValueUInt32(VerJob.pSetA, &hTest, "test_type", (uint32_t *)&enmTestTypeA);
     1813        AssertRCReturn(rc, rc);
    16131814        AUDIOTESTTYPE enmTestTypeB;
    1614         audioTestGetValueUInt32(VerJob.pSetB, szSec, "test_type", (uint32_t *)&enmTestTypeB);
     1815        rc = audioTestGetValueUInt32(VerJob.pSetB, &hTest, "test_type", (uint32_t *)&enmTestTypeB);
     1816        AssertRCReturn(rc, rc);
    16151817
    16161818        switch (enmTestTypeA)
     
    16201822                if (enmTestTypeB == AUDIOTESTTYPE_TESTTONE_RECORD)
    16211823                {
    1622                     rc = audioTestVerifyTestTone(&VerJob, szSec, VerJob.pSetA, VerJob.pSetB);
     1824                    rc = audioTestVerifyTestTone(&VerJob, &hTest, VerJob.pSetA, VerJob.pSetB);
    16231825                }
    16241826                else
     
    16301832            case AUDIOTESTTYPE_TESTTONE_RECORD:
    16311833            {
    1632                 if (enmTestTypeB != AUDIOTESTTYPE_TESTTONE_PLAY)
     1834                if (enmTestTypeB == AUDIOTESTTYPE_TESTTONE_PLAY)
    16331835                {
    1634                     rc = audioTestVerifyTestTone(&VerJob, szSec, VerJob.pSetB, VerJob.pSetA);
     1836                    rc = audioTestVerifyTestTone(&VerJob, &hTest, VerJob.pSetB, VerJob.pSetA);
    16351837                }
    16361838                else
  • trunk/src/VBox/Devices/Audio/AudioTest.h

    r89711 r89747  
    120120    /** Record a test tone. */
    121121    AUDIOTESTTYPE_TESTTONE_RECORD,
    122         /** The usual 32-bit hack. */
     122    /** The usual 32-bit hack. */
    123123    AUDIOTESTTYPE_32BIT_HACK = 0x7fffffff
    124124} AUDIOTESTTYPE;
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