Module: wine Branch: master Commit: f53dd40ad881cc7f887c0587d42f70bb07ddd2e0 URL: http://source.winehq.org/git/wine.git/?a=commit;h=f53dd40ad881cc7f887c0587d4...
Author: Andrew Eikum aeikum@codeweavers.com Date: Thu Nov 21 12:42:35 2013 -0600
winecoreaudio.drv: Don't return 0 absolute position if AudioQueue call fails.
Some failures are temporary, for example if the user reconfigures their audio setup while playing audio. Returning 0 could have bad "going backward in time" effects which can break audio even after the call starts to succeed again.
---
dlls/winecoreaudio.drv/mmdevdrv.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/dlls/winecoreaudio.drv/mmdevdrv.c b/dlls/winecoreaudio.drv/mmdevdrv.c index 914baa9..5e32229 100644 --- a/dlls/winecoreaudio.drv/mmdevdrv.c +++ b/dlls/winecoreaudio.drv/mmdevdrv.c @@ -688,6 +688,8 @@ static UINT64 get_current_aqbuffer_position(ACImpl *This, int mode) if(sc != noErr){ if(sc != kAudioQueueErr_InvalidRunState) WARN("Unable to get current time: %lx\n", sc); + if(mode == BUFPOS_ABSOLUTE) + return This->highest_sampletime; return 0; }