diff options
author | Kővágó, Zoltán <dirty.ice.hu@gmail.com> | 2015-06-12 14:33:04 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2015-06-15 12:42:48 +0200 |
commit | 2762955f723570944966347600b5746e7dd99388 (patch) | |
tree | 2cf06aabcfa572b2cab1c8de0e3c9491570e4e78 /audio/dsound_template.h | |
parent | 73ad33ef7ba0d1e7c7f276663f36c4f72b9193a9 (diff) |
dsoundaudio: remove *_retries kludges
According to MSDN this may happen when the window is not in the foreground, but
the default is 1 since a long time (which means no retries), so it should be ok.
I've found no problems during testing it on Windows 7 and wine, so this was
probably only the case with some old Windows versions.
Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'audio/dsound_template.h')
-rw-r--r-- | audio/dsound_template.h | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/audio/dsound_template.h b/audio/dsound_template.h index 85ba8582bb..b439f33f58 100644 --- a/audio/dsound_template.h +++ b/audio/dsound_template.h @@ -72,48 +72,27 @@ static int glue (dsound_lock_, TYPE) ( ) { HRESULT hr; - int i; LPVOID p1 = NULL, p2 = NULL; DWORD blen1 = 0, blen2 = 0; DWORD flag; - DSoundConf *conf = &s->conf; #ifdef DSBTYPE_IN flag = entire ? DSCBLOCK_ENTIREBUFFER : 0; #else flag = entire ? DSBLOCK_ENTIREBUFFER : 0; #endif - for (i = 0; i < conf->lock_retries; ++i) { - hr = glue (IFACE, _Lock) ( - buf, - pos, - len, - &p1, - &blen1, - &p2, - &blen2, - flag - ); + hr = glue(IFACE, _Lock)(buf, pos, len, &p1, &blen1, &p2, &blen2, flag); - if (FAILED (hr)) { + if (FAILED (hr)) { #ifndef DSBTYPE_IN - if (hr == DSERR_BUFFERLOST) { - if (glue (dsound_restore_, TYPE) (buf, s)) { - dsound_logerr (hr, "Could not lock " NAME "\n"); - goto fail; - } - continue; + if (hr == DSERR_BUFFERLOST) { + if (glue (dsound_restore_, TYPE) (buf, s)) { + dsound_logerr (hr, "Could not lock " NAME "\n"); } -#endif - dsound_logerr (hr, "Could not lock " NAME "\n"); goto fail; } - - break; - } - - if (i == conf->lock_retries) { - dolog ("%d attempts to lock " NAME " failed\n", i); +#endif + dsound_logerr (hr, "Could not lock " NAME "\n"); goto fail; } |