VirtualBox

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


Ignore:
Timestamp:
Jun 8, 2021 8:03:17 AM (4 years ago)
Author:
vboxsync
Message:

Audio/ValKit: Only report back bytes to read if a (current) test is active in drvHostValKitAudioHA_StreamGetReadable(). bugref:10008

File:
1 edited

Legend:

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

    r89541 r89557  
    423423static DECLCALLBACK(uint32_t) drvHostValKitAudioHA_StreamGetReadable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
    424424{
    425     RT_NOREF(pInterface, pStream);
    426     return UINT32_MAX;
     425    RT_NOREF(pStream);
     426
     427    PDRVHOSTVALKITAUDIO pThis = RT_FROM_MEMBER(pInterface, DRVHOSTVALKITAUDIO, IHostAudio);
     428
     429    int rc = RTCritSectEnter(&pThis->CritSect);
     430    if (RT_SUCCESS(rc))
     431    {
     432        pThis->pTestCur = RTListGetFirst(&pThis->lstTestsPlay, VALKITTESTDATA, Node);
     433
     434        int rc2 = RTCritSectLeave(&pThis->CritSect);
     435        AssertRC(rc2);
     436    }
     437
     438    if (pThis->pTestCur == NULL) /* Empty list? */
     439        return 0;
     440
     441    PVALKITTESTDATA const pTst = pThis->pTestCur;
     442
     443    Assert(pTst->t.TestTone.u.Rec.cbToWrite >= pTst->t.TestTone.u.Rec.cbWritten);
     444    return pTst->t.TestTone.u.Rec.cbToWrite - pTst->t.TestTone.u.Rec.cbWritten;
    427445}
    428446
     
    471489    if (pThis->pTestCur == NULL) /* Empty list? */
    472490    {
    473         LogRelMax(64, ("Audio: Validation Kit: Warning: Guest is playing back data when no playback test is active\n"));
    474 #ifdef DEBUG_andy
    475         AssertFailed();
    476 #endif
    477         *pcbWritten = 0;
     491        //LogRelMax(64, ("Audio: Validation Kit: Warning: Guest is playing back data when no playback test is active\n"));
     492
     493        *pcbWritten = cbBuf; /* Report all data as being written. */
    478494        return VINF_SUCCESS;
    479495    }
     
    570586    {
    571587        LogRelMax(64, ("Audio: Validation Kit: Warning: Guest is recording audio data when no recording test is active\n"));
    572 #ifdef DEBUG_andy
    573         AssertFailed();
    574 #endif
     588
    575589        *pcbRead = 0;
    576590        return VINF_SUCCESS;
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