Changeset 91647 in vbox
- Timestamp:
- Oct 8, 2021 6:48:43 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostAudioValidationKit.cpp
r91532 r91647 39 39 40 40 41 #ifdef DEBUG_andy 42 /** Enables dumping audio streams to the temporary directory for debugging. */ 43 # define VBOX_WITH_AUDIO_VALKIT_DUMP_STREAMS 44 #endif 45 46 41 47 /********************************************************************************************************************************* 42 48 * Structures and Typedefs * … … 53 59 /** How much bytes are available to read (only for capturing streams). */ 54 60 uint32_t cbAvail; 61 #ifdef VBOX_WITH_AUDIO_VALKIT_DUMP_STREAMS 62 /** Audio file to dump output to. */ 63 PAUDIOHLPFILE pFile; 64 #endif 55 65 } VALKITAUDIOSTREAM; 56 66 /** Pointer to a Validation Kit stream. */ … … 670 680 int rc = VINF_SUCCESS; 671 681 PDMAudioStrmCfgCopy(&pStreamDbg->Cfg, pCfgAcq); 682 683 #ifdef VBOX_WITH_AUDIO_VALKIT_DUMP_STREAMS 684 int rc2 = AudioHlpFileCreateAndOpenEx(&pStreamDbg->pFile, AUDIOHLPFILETYPE_WAV, NULL /*use temp dir*/, 685 pThis->pDrvIns->iInstance, AUDIOHLPFILENAME_FLAGS_NONE, AUDIOHLPFILE_FLAGS_NONE, 686 &pCfgReq->Props, RTFILE_O_WRITE | RTFILE_O_DENY_WRITE | RTFILE_O_CREATE_REPLACE, 687 pCfgReq->enmDir == PDMAUDIODIR_IN ? "ValKitAudioIn" : "ValKitAudioOut"); 688 if (RT_FAILURE(rc2)) 689 LogRel(("ValKit: Failed to creating debug file for %s stream '%s' in the temp directory: %Rrc\n", 690 pCfgReq->enmDir == PDMAUDIODIR_IN ? "input" : "output", pCfgReq->szName, rc2)); 691 #endif 692 672 693 return rc; 673 694 } … … 682 703 PVALKITAUDIOSTREAM pStreamDbg = (PVALKITAUDIOSTREAM)pStream; 683 704 AssertPtrReturn(pStreamDbg, VERR_INVALID_POINTER); 705 706 #ifdef VBOX_WITH_AUDIO_VALKIT_DUMP_STREAMS 707 if (pStreamDbg->pFile) 708 { 709 AudioHlpFileDestroy(pStreamDbg->pFile); 710 pStreamDbg->pFile = NULL; 711 } 712 #endif 684 713 685 714 return VINF_SUCCESS; … … 858 887 PVALKITTESTDATA pTst = NULL; 859 888 889 int rc2; 890 #ifdef VBOX_WITH_AUDIO_VALKIT_DUMP_STREAMS 891 PVALKITAUDIOSTREAM pStrmValKit = (PVALKITAUDIOSTREAM)pStream; 892 rc2 = AudioHlpFileWrite(pStrmValKit->pFile, pvBuf, cbBuf); 893 AssertRC(rc2); 894 #endif 895 860 896 bool const fIsSilence = PDMAudioPropsIsBufferSilence(&pStream->pStream->Cfg.Props, pvBuf, cbBuf); 861 897 … … 879 915 pTst = pThis->pTestCurPlay; 880 916 881 intrc2 = RTCritSectLeave(&pThis->CritSect);917 rc2 = RTCritSectLeave(&pThis->CritSect); 882 918 AssertRC(rc2); 883 919 } … … 970 1006 pTst = NULL; 971 1007 972 intrc2 = RTCritSectLeave(&pThis->CritSect);1008 rc2 = RTCritSectLeave(&pThis->CritSect); 973 1009 if (RT_SUCCESS(rc)) 974 1010 rc = rc2;
Note:
See TracChangeset
for help on using the changeset viewer.