Changeset 99311 in vbox for trunk/src/VBox
- Timestamp:
- Apr 6, 2023 7:20:06 AM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
r98625 r99311 2030 2030 } 2031 2031 2032 /** Validate locks -- see @bugref{10350}. */ 2033 Assert(PDMDevHlpCritSectIsOwner(pDevIns, &pThis->CritSect)); 2034 Assert(RTCritSectIsOwned(&pStreamCC->State.CritSect)); 2035 Assert(AudioMixerSinkLockIsOwned(pMixSink)); 2036 2032 2037 /* 2033 2038 * Don't continue if the frequency is out of range (the rest of the … … 2273 2278 * @param fForce Whether to force re-opening the stream or not. 2274 2279 * Otherwise re-opening only will happen if the PCM properties have changed. 2280 * 2281 * @remarks This is called holding: 2282 * -# The AC'97 device lock. 2283 * 2284 * Will acquire the stream and mixer sink locks. See @bugref{10350} 2275 2285 */ 2276 2286 static int ichac97R3StreamReSetUp(PPDMDEVINS pDevIns, PAC97STATE pThis, PAC97STATER3 pThisCC, … … 2282 2292 Assert(pStream - &pThis->aStreams[0] == pStream->u8SD); 2283 2293 Assert(pStreamCC - &pThisCC->aStreams[0] == pStream->u8SD); 2294 2295 ichac97R3StreamLock(pStreamCC); 2296 PAUDMIXSINK const pSink = ichac97R3IndexToSink(pThisCC, pStream->u8SD); 2297 if (pSink) 2298 AudioMixerSinkLock(pSink); 2284 2299 2285 2300 ichac97R3StreamTearDown(pStream); … … 2289 2304 else 2290 2305 STAM_REL_PROFILE_STOP_NS(&pStreamCC->State.StatReSetUpChanged, r); 2306 2307 if (pSink) 2308 AudioMixerSinkUnlock(pSink); 2309 ichac97R3StreamUnlock(pStreamCC); 2310 2291 2311 return rc; 2292 2312 } … … 2310 2330 ichac97R3StreamLock(pStreamCC); 2311 2331 PAUDMIXSINK const pSink = ichac97R3IndexToSink(pThisCC, pStream->u8SD); 2312 AudioMixerSinkLock(pSink); 2332 if (pSink) 2333 AudioMixerSinkLock(pSink); 2313 2334 2314 2335 int rc = VINF_SUCCESS; … … 2340 2361 2341 2362 /* Do the actual enabling (won't fail as long as pSink is valid). */ 2342 rc = AudioMixerSinkStart(pSink); 2363 if (pSink) 2364 rc = AudioMixerSinkStart(pSink); 2343 2365 } 2344 2366 } … … 2353 2375 2354 2376 /* Make sure to leave the lock before (eventually) starting the timer. */ 2355 AudioMixerSinkUnlock(pSink); 2377 if (pSink) 2378 AudioMixerSinkUnlock(pSink); 2356 2379 ichac97R3StreamUnlock(pStreamCC); 2357 2380 LogFunc(("[SD%RU8] fEnable=%RTbool, rc=%Rrc\n", pStream->u8SD, fEnable, rc));
Note:
See TracChangeset
for help on using the changeset viewer.