Changeset 82356 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Dec 3, 2019 9:26:49 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
r82346 r82356 677 677 DECLINLINE(PAUDMIXSINK) ichac97R3IndexToSink(PAC97STATE pThis, uint8_t uIndex) 678 678 { 679 AssertPtrReturn(pThis, NULL);680 681 679 switch (uIndex) 682 680 { … … 811 809 static bool ichac97R3StreamIsEnabled(PAC97STATE pThis, PAC97STREAM pStream) 812 810 { 813 AssertPtrReturn(pThis, false);814 AssertPtrReturn(pStream, false);815 816 811 PAUDMIXSINK pSink = ichac97R3IndexToSink(pThis, pStream->u8SD); 817 812 bool fIsEnabled = RT_BOOL(AudioMixerSinkGetStatus(pSink) & AUDMIXSINK_STS_RUNNING); … … 832 827 static int ichac97R3StreamEnable(PAC97STATE pThis, PAC97STREAM pStream, bool fEnable) 833 828 { 834 AssertPtrReturn(pThis, VERR_INVALID_POINTER);835 AssertPtrReturn(pStream, VERR_INVALID_POINTER);836 837 829 ichac97R3StreamLock(pStream); 838 830 … … 900 892 static void ichac97R3StreamReset(PAC97STATE pThis, PAC97STREAM pStream) 901 893 { 902 AssertPtrReturnVoid(pThis);903 AssertPtrReturnVoid(pStream);904 905 894 ichac97R3StreamLock(pStream); 906 895 … … 937 926 { 938 927 RT_NOREF(pThis); 939 AssertPtrReturn(pStream, VERR_INVALID_PARAMETER);940 /** @todo Validate u8Strm. */941 928 942 929 LogFunc(("[SD%RU8] pStream=%p\n", u8SD, pStream)); … … 1090 1077 { 1091 1078 RT_NOREF(pThis); 1092 AssertPtrReturn(pDstStream, VERR_INVALID_POINTER); 1093 AssertPtrReturn(pSrcMixSink, VERR_INVALID_POINTER); 1094 AssertReturn(cbToWrite, VERR_INVALID_PARAMETER); 1079 AssertReturn(cbToWrite > 0, VERR_INVALID_PARAMETER); 1095 1080 /* pcbWritten is optional. */ 1096 1081 … … 1136 1121 { 1137 1122 RT_NOREF(pThis); 1138 AssertPtrReturn(pSrcStream, VERR_INVALID_POINTER); 1139 AssertPtrReturn(pDstMixSink, VERR_INVALID_POINTER); 1140 AssertReturn(cbToRead, VERR_INVALID_PARAMETER); 1123 AssertReturn(cbToRead > 0, VERR_INVALID_PARAMETER); 1141 1124 /* pcbRead is optional. */ 1142 1125 … … 1700 1683 static int ichac97R3MixerAddDrvStream(PAC97STATE pThis, PAUDMIXSINK pMixSink, PPDMAUDIOSTREAMCFG pCfg, PAC97DRIVER pDrv) 1701 1684 { 1702 AssertPtrReturn(pThis, VERR_INVALID_POINTER);1703 1685 AssertPtrReturn(pMixSink, VERR_INVALID_POINTER); 1704 AssertPtrReturn(pCfg, VERR_INVALID_POINTER);1705 1686 1706 1687 PPDMAUDIOSTREAMCFG pStreamCfg = DrvAudioHlpStreamCfgDup(pCfg); … … 1783 1764 static int ichac97R3MixerAddDrvStreams(PAC97STATE pThis, PAUDMIXSINK pMixSink, PPDMAUDIOSTREAMCFG pCfg) 1784 1765 { 1785 AssertPtrReturn(pThis, VERR_INVALID_POINTER);1786 1766 AssertPtrReturn(pMixSink, VERR_INVALID_POINTER); 1787 AssertPtrReturn(pCfg, VERR_INVALID_POINTER);1788 1767 1789 1768 if (!DrvAudioHlpStreamCfgIsValid(pCfg)) … … 1856 1835 static void ichac97R3MixerRemoveDrv(PAC97STATE pThis, PAC97DRIVER pDrv) 1857 1836 { 1858 AssertPtrReturnVoid(pThis);1859 AssertPtrReturnVoid(pDrv);1860 1861 1837 if (pDrv->MicIn.pMixStrm) 1862 1838 { … … 1901 1877 PDMAUDIODIR enmDir, PDMAUDIODSTSRCUNION dstSrc, PAC97DRIVER pDrv) 1902 1878 { 1903 AssertPtrReturnVoid(pThis);1904 AssertPtrReturnVoid(pMixSink);1905 1906 1879 PAC97DRIVERSTREAM pDrvStream = ichac97R3MixerGetDrvStream(pThis, pDrv, enmDir, dstSrc); 1907 1880 if (pDrvStream) … … 1928 1901 PDMAUDIODIR enmDir, PDMAUDIODSTSRCUNION dstSrc) 1929 1902 { 1930 AssertPtrReturnVoid(pThis);1931 1903 AssertPtrReturnVoid(pMixSink); 1932 1904 … … 2153 2125 static void ichac97R3StreamLock(PAC97STREAM pStream) 2154 2126 { 2155 AssertPtrReturnVoid(pStream);2156 2127 int rc2 = RTCritSectEnter(&pStream->State.CritSect); 2157 2128 AssertRC(rc2); … … 2166 2137 static void ichac97R3StreamUnlock(PAC97STREAM pStream) 2167 2138 { 2168 AssertPtrReturnVoid(pStream);2169 2139 int rc2 = RTCritSectLeave(&pStream->State.CritSect); 2170 2140 AssertRC(rc2); … … 2179 2149 static uint32_t ichac97R3StreamGetUsed(PAC97STREAM pStream) 2180 2150 { 2181 AssertPtrReturn(pStream, 0);2182 2183 2151 if (!pStream->State.pCircBuf) 2184 2152 return 0; … … 2195 2163 static uint32_t ichac97R3StreamGetFree(PAC97STREAM pStream) 2196 2164 { 2197 AssertPtrReturn(pStream, 0);2198 2199 2165 if (!pStream->State.pCircBuf) 2200 2166 return 0; … … 2493 2459 static int ichac97R3MixerReset(PAC97STATE pThis) 2494 2460 { 2495 AssertPtrReturn(pThis, VERR_INVALID_PARAMETER);2496 2497 2461 LogFlowFuncEnter(); 2498 2462 … … 2668 2632 static int ichac97R3StreamTransfer(PPDMDEVINS pDevIns, PAC97STATE pThis, PAC97STREAM pStream, uint32_t cbToProcessMax) 2669 2633 { 2670 AssertPtrReturn(pThis, VERR_INVALID_POINTER);2671 AssertPtrReturn(pStream, VERR_INVALID_POINTER);2672 2673 2634 if (!cbToProcessMax) 2674 2635 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.