From 5b10bce652ede36e8f6861b9086933ce97889696 Mon Sep 17 00:00:00 2001
From: Andrew Eikum <aeikum@codeweavers.com>
Date: Mon, 27 Aug 2018 08:33:32 -0500
Subject: winepulse: Update last time on underrun
To: wine-devel <wine-devel@winehq.org>
Reply-To: wine-devel <wine-devel@winehq.org>,Andrew Eikum <aeikum@codeweavers.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------2.18.0"

This is a multi-part message in MIME format.
--------------2.18.0
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit

---
 dlls/winepulse.drv/mmdevdrv.c | 5 +++++
 1 file changed, 5 insertions(+)


--------------2.18.0
Content-Type: text/x-patch; name="0010-winepulse-Update-last-time-on-underrun.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline; filename="0010-winepulse-Update-last-time-on-underrun.patch"

diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c
index 48ed585cc1..1ce6cea9d6 100644
--- a/dlls/winepulse.drv/mmdevdrv.c
+++ b/dlls/winepulse.drv/mmdevdrv.c
@@ -1111,6 +1111,11 @@ static DWORD WINAPI pulse_timer_cb(void *user)
         if(err == 0){
             TRACE("got now: %s, last time: %s\n", wine_dbgstr_longlong(now), wine_dbgstr_longlong(This->last_time));
             if(This->started && (This->dataflow == eCapture || This->held_bytes)){
+                if(This->just_underran){
+                    This->last_time = now;
+                    This->just_started = TRUE;
+                }
+
                 if(This->just_started){
                     /* let it play out a period to absorb some latency and get accurate timing */
                     pa_usec_t diff = now - This->last_time;

--------------2.18.0--


