Changeset 68415 in vbox for trunk/src/VBox
- Timestamp:
- Aug 15, 2017 8:09:42 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
r68412 r68415 472 472 static uint32_t ichac97StreamGetFree(PAC97STREAM pStream); 473 473 static int ichac97StreamTransfer(PAC97STATE pThis, PAC97STREAM pStream, uint32_t cbToProcessMax); 474 static void ichac97StreamUpdate(PAC97STATE pThis, PAC97STREAM pStream, bool fInTimer); 474 475 475 476 static DECLCALLBACK(void) ichac97Reset(PPDMDEVINS pDevIns); … … 1016 1017 } 1017 1018 1018 uint32_t cbToProcess; 1019 uint32_t cbProcessed = 0; 1020 1021 switch (pStream->u8SD) 1022 { 1023 /* Input. */ 1024 case AC97SOUNDSOURCE_PI_INDEX: 1025 case AC97SOUNDSOURCE_MC_INDEX: 1026 { 1027 cbToProcess = (uint32_t)RTCircBufFree(pCircBuf); 1028 if (cbToProcess) 1029 rc2 = ichac97StreamWrite(pThis, pStream, pMixSink, (uint32_t)cbToProcess, &cbProcessed); 1030 break; 1031 } 1032 1033 /* Output. */ 1034 case AC97SOUNDSOURCE_PO_INDEX: 1035 { 1036 cbToProcess = (uint32_t)RTCircBufUsed(pCircBuf); 1037 if (cbToProcess) 1038 rc2 = ichac97StreamRead(pThis, pStream, pMixSink, (uint32_t)cbToProcess, &cbProcessed); 1039 break; 1040 } 1041 1042 default: 1043 AssertFailedStmt(rc2 = VERR_NOT_SUPPORTED); 1044 break; 1045 } 1046 1047 if (RT_SUCCESS(rc2)) 1048 rc2 = AudioMixerSinkUpdate(pMixSink); 1019 ichac97StreamUpdate(pThis, pStream, false /* fInTimer */); 1049 1020 1050 1021 int rc3 = RTCritSectLeave(&pAIO->CritSect); … … 1219 1190 static void ichac97StreamUpdate(PAC97STATE pThis, PAC97STREAM pStream, bool fInTimer) 1220 1191 { 1221 ichac97StreamLock(pStream);1222 1223 1192 PAUDMIXSINK pSink = ichac97IndexToSink(pThis, pStream->u8SD); 1224 1193 AssertPtr(pSink); 1225 1194 1226 1195 if (!AudioMixerSinkIsActive(pSink)) /* No sink available? Bail out. */ 1227 {1228 ichac97StreamUnlock(pStream);1229 1196 return; 1230 }1231 1197 1232 1198 int rc2; … … 1340 1306 #endif 1341 1307 } 1342 1343 ichac97StreamUnlock(pStream);1344 1308 } 1345 1309 … … 2188 2152 AssertReturn(cbToProcessMax, VERR_INVALID_PARAMETER); 2189 2153 2154 ichac97StreamLock(pStream); 2155 2190 2156 PAC97BMREGS pRegs = &pStream->Regs; 2191 2157 … … 2205 2171 } 2206 2172 2173 ichac97StreamUnlock(pStream); 2207 2174 return VINF_SUCCESS; 2208 2175 } … … 2212 2179 { 2213 2180 Log3Func(("[SD%RU8] BCIS set\n", pStream->u8SD)); 2181 2182 ichac97StreamUnlock(pStream); 2214 2183 return VINF_SUCCESS; 2215 2184 } … … 2375 2344 } 2376 2345 } 2346 2347 ichac97StreamUnlock(pStream); 2377 2348 2378 2349 LogFlowFuncLeaveRC(rc);
Note:
See TracChangeset
for help on using the changeset viewer.