Changeset 82332 in vbox for trunk/src/VBox/Devices/Audio/DevHDACommon.cpp
- Timestamp:
- Dec 3, 2019 12:30:11 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHDACommon.cpp
r82331 r82332 665 665 * @returns Whether the new expiration time was set or not. 666 666 * @param pDevIns The device instance. 667 * @param pThis HDA state.668 667 * @param pStream HDA stream to set timer for. 669 668 * @param tsExpire New (virtual) expiration time to set. 670 669 * @param fForce Whether to force setting the expiration time or not. 670 * @param tsNow The current clock timestamp if available, 0 if not. 671 671 * 672 672 * @remark This function takes all active HDA streams and their … … 679 679 * Forcing a new expiration time will override the above mechanism. 680 680 */ 681 bool hdaR3TimerSet(PPDMDEVINS pDevIns, PHDASTATE pThis, PHDASTREAM pStream, uint64_t tsExpire, bool fForce) 682 { 683 AssertPtr(pThis); 681 bool hdaR3TimerSet(PPDMDEVINS pDevIns, PHDASTREAM pStream, uint64_t tsExpire, bool fForce, uint64_t tsNow) 682 { 684 683 AssertPtr(pStream); 685 684 686 uint64_t tsExpireMin = tsExpire; 685 if (!tsNow) 686 tsNow = PDMDevHlpTimerGet(pDevIns, pStream->hTimer); 687 687 688 688 if (!fForce) … … 691 691 * PDMDevHlpTimerGet(), so, some callers does one, this does, and then we do 692 692 * right afterwards == very inefficient! */ 693 if (hdaR3StreamTransferIsScheduled(p DevIns, pStream))693 if (hdaR3StreamTransferIsScheduled(pStream, tsNow)) 694 694 { 695 695 uint64_t const tsNext = hdaR3StreamTransferGetNext(pStream); 696 if (tsExpire Min> tsNext)697 tsExpire Min= tsNext;696 if (tsExpire > tsNext) 697 tsExpire = tsNext; 698 698 } 699 699 } 700 701 const uint64_t tsNow = PDMDevHlpTimerGet(pDevIns, pStream->hTimer);702 700 703 701 /* … … 705 703 * This in theory could happen in hdaR3StreamTransferGetNext() from above. 706 704 */ 707 if (tsExpire Min< tsNow)708 tsExpire Min= tsNow;709 710 int rc = PDMDevHlpTimerSet(pDevIns, pStream->hTimer, tsExpire Min);705 if (tsExpire < tsNow) 706 tsExpire = tsNow; 707 708 int rc = PDMDevHlpTimerSet(pDevIns, pStream->hTimer, tsExpire); 711 709 AssertRCReturn(rc, false); 712 710
Note:
See TracChangeset
for help on using the changeset viewer.