VirtualBox

Changeset 90079 in vbox for trunk


Ignore:
Timestamp:
Jul 7, 2021 5:18:31 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
145576
Message:

Audio/ValKit: Device detection / enumeration fixes. bugref:10008

Location:
trunk/src/VBox/ValidationKit/utils/audio
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/utils/audio/vkat.cpp

    r90044 r90079  
    663663    int rc = AudioTestSvcCreate(&TstEnv.u.Guest.Srv);
    664664
    665     const char *pszDevice     = NULL; /* Custom device to use. Can be NULL if not being used. */
    666665    const char *pszTag        = NULL; /* Custom tag to use. Can be NULL if not being used. */
    667666    PCPDMDRVREG pDrvReg       = AudioTestGetDefaultBackend();
     
    740739
    741740            case VKAT_TEST_OPT_DEV:
    742                 pszDevice = ValueUnion.psz;
     741                rc = RTStrCopy(TstEnv.szDev, sizeof(TstEnv.szDev), ValueUnion.psz);
     742                if (RT_FAILURE(rc))
     743                    return RTMsgErrorExitFailure("Failed to copy out device: %Rrc", rc);
    743744                break;
    744745
  • trunk/src/VBox/ValidationKit/utils/audio/vkatCommon.cpp

    r89994 r90079  
    8888static int audioTestDevicesEnumerateAndCheck(PAUDIOTESTENV pTstEnv, const char *pszDev, PPDMAUDIOHOSTDEV *ppDev)
    8989{
    90 #ifdef DEBUG_andy
    91     return VINF_SUCCESS;
    92 #endif
    93 
    94     RTTestSubF(g_hTest, "Enumerating audio devices and checking for device '%s'", pszDev ? pszDev : "<Default>");
     90    RTTestSubF(g_hTest, "Enumerating audio devices and checking for device '%s'", pszDev && *pszDev ? pszDev : "<Default>");
    9591
    9692    if (!pTstEnv->DrvStack.pIHostAudio->pfnGetDevices)
     
    121117            RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Enum:   Output channels = %RU8\n", pDev->cMaxOutputChannels);
    122118
    123             if (   pszDev
     119            if (   (pszDev && *pszDev)
    124120                && !RTStrCmp(pDev->pszName, pszDev))
    125121            {
     
    131127        RTTestFailed(g_hTest, "Enumerating audio devices failed with %Rrc", rc);
    132128
     129    if (RT_SUCCESS(rc))
     130    {
     131        if (   (pszDev && *pszDev)
     132            && *ppDev == NULL)
     133        {
     134            RTTestFailed(g_hTest, "Audio device '%s' not found", pszDev);
     135            rc = VERR_NOT_FOUND;
     136        }
     137    }
     138
    133139    RTTestSubDone(g_hTest);
    134 
    135     if (   pszDev
    136         && *ppDev == NULL)
    137     {
    138         RTTestFailed(g_hTest, "Audio device '%s' not found", pszDev);
    139         return VERR_NOT_FOUND;
    140     }
    141 
    142     return VINF_SUCCESS;
     140    return rc;
    143141}
    144142
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