- Timestamp:
- Jul 6, 2021 11:15:47 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 145551
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostAudioValidationKit.cpp
r89994 r90056 131 131 /** List keeping the recording tests (FIFO). */ 132 132 RTLISTANCHOR lstTestsRec; 133 /** Pointer to current recording test being processed. 134 * NULL if no current test active. */ 135 PVALKITTESTDATA pTestCurRec; 133 136 /** Number of tests in \a lstTestsPlay. */ 134 137 uint32_t cTestsPlay; 135 138 /** List keeping the recording tests (FIFO). */ 136 139 RTLISTANCHOR lstTestsPlay; 137 /** Pointer to current test being processed. */ 138 PVALKITTESTDATA pTestCur; 140 /** Pointer to current playback test being processed. 141 * NULL if no current test active. */ 142 PVALKITTESTDATA pTestCurPlay; 139 143 /** Critical section for serializing access across threads. */ 140 144 RTCRITSECT CritSect; … … 635 639 if (RT_SUCCESS(rc)) 636 640 { 637 PVALKITTESTDATA pTst = pThis->pTestCur ;641 PVALKITTESTDATA pTst = pThis->pTestCurPlay; 638 642 639 643 if (pTst) … … 648 652 AudioTestSetTestDone(pTst->pEntry); 649 653 650 pThis->pTestCur = NULL;651 pTst = NULL;654 pThis->pTestCurPlay = NULL; 655 pTst = NULL; 652 656 653 657 if (pThis->fTestSetEnded) … … 671 675 672 676 PDRVHOSTVALKITAUDIO pThis = RT_FROM_MEMBER(pInterface, DRVHOSTVALKITAUDIO, IHostAudio); 677 PVALKITTESTDATA pTst = NULL; 673 678 674 679 int rc = RTCritSectEnter(&pThis->CritSect); 675 680 if (RT_SUCCESS(rc)) 676 681 { 677 pT his->pTestCur = RTListGetFirst(&pThis->lstTestsPlay, VALKITTESTDATA, Node);682 pTst = RTListGetFirst(&pThis->lstTestsRec, VALKITTESTDATA, Node); 678 683 679 684 int rc2 = RTCritSectLeave(&pThis->CritSect); … … 681 686 } 682 687 683 if (pT his->pTestCur== NULL) /* Empty list? */688 if (pTst == NULL) /* Empty list? */ 684 689 return 0; 685 686 PVALKITTESTDATA const pTst = pThis->pTestCur;687 690 688 691 Assert(pTst->t.TestTone.u.Rec.cbToWrite >= pTst->t.TestTone.u.Rec.cbWritten); … … 727 730 728 731 PDRVHOSTVALKITAUDIO pThis = RT_FROM_MEMBER(pInterface, DRVHOSTVALKITAUDIO, IHostAudio); 732 PVALKITTESTDATA pTst = NULL; 729 733 730 734 bool const fIsSilence = PDMAudioPropsIsBufferSilence(&pStream->pStream->Cfg.Props, pvBuf, cbBuf); … … 733 737 if (RT_SUCCESS(rc)) 734 738 { 735 if (pThis->pTestCur == NULL) 736 { 737 pThis->pTestCur = RTListGetFirst(&pThis->lstTestsPlay, VALKITTESTDATA, Node); 738 if (pThis->pTestCur) 739 LogRel(("ValKit: Next guest playback test in queue is test #%RU32\n", pThis->pTestCur->idxTest)); 740 } 739 if (pThis->pTestCurPlay == NULL) 740 { 741 pThis->pTestCurPlay = RTListGetFirst(&pThis->lstTestsPlay, VALKITTESTDATA, Node); 742 if (pThis->pTestCurPlay) 743 LogRel(("ValKit: Next guest playback test in queue is test #%RU32\n", pThis->pTestCurPlay->idxTest)); 744 } 745 746 pTst = pThis->pTestCurPlay; 741 747 742 748 int rc2 = RTCritSectLeave(&pThis->CritSect); … … 744 750 } 745 751 746 if (pT his->pTestCur== NULL) /* Empty list? */752 if (pTst == NULL) /* Empty list? */ 747 753 { 748 754 #ifdef DEBUG_andy … … 762 768 #endif 763 769 764 PVALKITTESTDATA pTst = pThis->pTestCur;765 766 770 const bool fHandleSilence = false; /** @todo Skip blocks of entire silence for now. */ 767 771 768 if (pTst->pEntry == NULL) 772 if (pTst->pEntry == NULL) /* Test not started yet? */ 769 773 { 770 774 AUDIOTESTPARMS Parms; … … 814 818 drvHostValKiUnregisterPlayTest(pThis, pTst); 815 819 816 pThis->pTestCur = NULL;817 pTst = NULL;820 pThis->pTestCurPlay = NULL; 821 pTst = NULL; 818 822 819 823 int rc2 = RTCritSectLeave(&pThis->CritSect); … … 858 862 859 863 PDRVHOSTVALKITAUDIO pThis = RT_FROM_MEMBER(pInterface, DRVHOSTVALKITAUDIO, IHostAudio); 864 PVALKITTESTDATA pTst = NULL; 860 865 861 866 int rc = RTCritSectEnter(&pThis->CritSect); 862 867 if (RT_SUCCESS(rc)) 863 868 { 864 if (pThis->pTestCur == NULL) 865 { 866 pThis->pTestCur = RTListGetFirst(&pThis->lstTestsRec, VALKITTESTDATA, Node); 867 if (pThis->pTestCur) 868 LogRel(("ValKit: Next guest recording test in queue is test #%RU32\n", pThis->pTestCur->idxTest)); 869 } 869 if (pThis->pTestCurRec == NULL) 870 { 871 pThis->pTestCurRec = RTListGetFirst(&pThis->lstTestsRec, VALKITTESTDATA, Node); 872 if (pThis->pTestCurRec) 873 LogRel(("ValKit: Next guest recording test in queue is test #%RU32\n", pThis->pTestCurRec->idxTest)); 874 } 875 876 pTst = pThis->pTestCurRec; 870 877 871 878 int rc2 = RTCritSectLeave(&pThis->CritSect); … … 873 880 } 874 881 875 if (pT his->pTestCur== NULL) /* Empty list? */882 if (pTst == NULL) /* Empty list? */ 876 883 { 877 884 LogRelMax(64, ("ValKit: Warning: Guest is trying to record audio data when no recording test is active\n")); … … 881 888 } 882 889 883 PVALKITTESTDATA pTst = pThis->pTestCur; 884 885 if (pTst->pEntry == NULL) 890 if (pTst->pEntry == NULL) /* Test not started yet? */ 886 891 { 887 892 AUDIOTESTPARMS Parms; … … 934 939 drvHostValKiUnregisterRecTest(pThis, pTst); 935 940 936 pThis->pTestCur = NULL;937 pTst = NULL;941 pThis->pTestCurRec = NULL; 942 pTst = NULL; 938 943 939 944 int rc2 = RTCritSectLeave(&pThis->CritSect);
Note:
See TracChangeset
for help on using the changeset viewer.