Changeset 89128 in vbox for trunk/src/VBox
- Timestamp:
- May 17, 2021 11:31:36 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 144469
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostAudioWasApi.cpp
r89089 r89128 294 294 static RTSTRTUPLE const s_aEnable[2] = 295 295 { 296 RT_STR_TUPLE("DISABLED"),297 RT_STR_TUPLE("ENABLED ")296 { RT_STR_TUPLE("DISABLED") }, 297 { RT_STR_TUPLE("ENABLED ") }, 298 298 }; 299 299 PCRTSTRTUPLE pTuple = &s_aEnable[pStreamWas->fEnabled]; … … 303 303 static RTSTRTUPLE const s_aStarted[2] = 304 304 { 305 RT_STR_TUPLE(" STOPPED"),306 RT_STR_TUPLE(" STARTED")305 { RT_STR_TUPLE(" STOPPED") }, 306 { RT_STR_TUPLE(" STARTED") }, 307 307 }; 308 308 pTuple = &s_aStarted[pStreamWas->fStarted]; … … 312 312 static RTSTRTUPLE const s_aDraining[2] = 313 313 { 314 RT_STR_TUPLE(""),315 RT_STR_TUPLE(" DRAINING")314 { RT_STR_TUPLE("") }, 315 { RT_STR_TUPLE(" DRAINING") }, 316 316 }; 317 317 pTuple = &s_aDraining[pStreamWas->fDraining]; … … 319 319 off += pTuple->cch; 320 320 321 Assert(off < sizeof(pStreamCA->szStatus)); 321 322 pStreamWas->szStatus[off] = '\0'; 322 323 return pStreamWas->szStatus; … … 2126 2127 2127 2128 /* 2128 * We will not stop a draining output stream, otherwise the actions are the same here.2129 * Always try stop it (draining or no). 2129 2130 */ 2130 2131 pStreamWas->fEnabled = false; … … 2250 2251 if (!pStreamWas->fDraining) 2251 2252 { 2252 if (pStreamWas->fStarted) 2253 uint64_t const msNow = RTTimeMilliTS(); 2254 uint64_t msDrainDeadline = 0; 2255 UINT32 cFramesPending = 0; 2256 HRESULT hrc = pStreamWas->pDevCfg->pIAudioClient->GetCurrentPadding(&cFramesPending); 2257 if (SUCCEEDED(hrc)) 2258 msDrainDeadline = msNow 2259 + PDMAudioPropsFramesToMilli(&pStreamWas->Cfg.Props, 2260 RT_MIN(cFramesPending, 2261 pStreamWas->Cfg.Backend.cFramesBufferSize * 2)) 2262 + 1 /*fudge*/; 2263 else 2253 2264 { 2254 uint64_t const msNow = RTTimeMilliTS(); 2255 uint64_t msDrainDeadline = 0; 2256 UINT32 cFramesPending = 0; 2257 HRESULT hrc = pStreamWas->pDevCfg->pIAudioClient->GetCurrentPadding(&cFramesPending); 2258 if (SUCCEEDED(hrc)) 2259 msDrainDeadline = msNow 2260 + PDMAudioPropsFramesToMilli(&pStreamWas->Cfg.Props, 2261 RT_MIN(cFramesPending, 2262 pStreamWas->Cfg.Backend.cFramesBufferSize * 2)) 2263 + 1 /*fudge*/; 2264 else 2265 { 2266 msDrainDeadline = msNow; 2267 LogRelMax(64, ("WasAPI: GetCurrentPadding fail on '%s' when starting draining: %Rhrc\n", 2268 pStreamWas->Cfg.szName, hrc)); 2269 } 2270 pStreamWas->msDrainDeadline = msDrainDeadline; 2271 pStreamWas->fDraining = true; 2265 msDrainDeadline = msNow; 2266 LogRelMax(64, ("WasAPI: GetCurrentPadding fail on '%s' when starting draining: %Rhrc\n", 2267 pStreamWas->Cfg.szName, hrc)); 2272 2268 } 2273 else2274 LogFlowFunc(("Drain requested for '%s', but not started playback...\n", pStreamWas->Cfg.szName));2269 pStreamWas->msDrainDeadline = msDrainDeadline; 2270 pStreamWas->fDraining = true; 2275 2271 } 2276 2272 else … … 2278 2274 } 2279 2275 else 2276 { 2277 LogFlowFunc(("Drain requested for '%s', but not started playback...\n", pStreamWas->Cfg.szName)); 2280 2278 AssertStmt(!pStreamWas->fDraining, pStreamWas->fDraining = false); 2279 } 2281 2280 RTCritSectLeave(&pStreamWas->CritSect); 2282 2281 … … 2626 2625 rc = VINF_SUCCESS; 2627 2626 } 2628 LogFlowFunc(("@%#RX64: cbWritten=%RU32 cMsDelta=%RU64 (%RU64 -> %RU64) {%s}\n", pStreamWas->offInternal, cbWritten,2627 LogFlowFunc(("@%#RX64: rc=%Rrc cbWritten=%RU32 cMsDelta=%RU64 (%RU64 -> %RU64) {%s}\n", pStreamWas->offInternal, rc, cbWritten, 2629 2628 msPrev ? msNow - msPrev : 0, msPrev, pStreamWas->msLastTransfer, drvHostWasStreamStatusString(pStreamWas) )); 2630 return VINF_SUCCESS;2629 return rc; 2631 2630 } 2632 2631 … … 2774 2773 rc = VINF_SUCCESS; 2775 2774 } 2776 LogFlowFunc(("@%#RX64: cbRead=%RU32 cMsDelta=%RU64 (%RU64 -> %RU64) {%s}\n", pStreamWas->offInternal, cbRead,2775 LogFlowFunc(("@%#RX64: rc=%Rrc cbRead=%RU32 cMsDelta=%RU64 (%RU64 -> %RU64) {%s}\n", pStreamWas->offInternal, rc, cbRead, 2777 2776 msPrev ? msNow - msPrev : 0, msPrev, pStreamWas->msLastTransfer, drvHostWasStreamStatusString(pStreamWas) )); 2778 2777 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.