[Bug 59874] New: winmm: infinite playback on waveOutWrite with WHDR_BEGINLOOP|WHDR_ENDLOOP and dwLoops=0
http://bugs.winehq.org/show_bug.cgi?id=59874 Bug ID: 59874 Summary: winmm: infinite playback on waveOutWrite with WHDR_BEGINLOOP|WHDR_ENDLOOP and dwLoops=0 Product: Wine Version: 11.11 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winmm&mci Assignee: wine-bugs@list.winehq.org Reporter: nedsociety@gmail.com Distribution: ArchLinux Created attachment 81179 --> http://bugs.winehq.org/attachment.cgi?id=81179 MRE In wine/dlls/winmm/waveform.c, the audio fill callback handles the combined-flag case with two sequential if statements (not if/else if), so both branches execute in the same pass when a buffer carries both flags: ```c if(queue->dwFlags & WHDR_BEGINLOOP){ device->loop_start = device->playing; device->playing = queue->lpNext; device->loop_counter = queue->dwLoops; /* set to 0 */ } if(queue->dwFlags & WHDR_ENDLOOP){ --device->loop_counter; /* underflows 0xFFFFFFFF */ if(device->loop_counter) /* loops back */ device->playing = device->loop_start; else device->loop_start = device->playing = queue->lpNext; } ``` Under `WHDR_BEGINLOOP | WHDR_ENDLOOP && dwLoops=0` the loop counter underflows as noted above, producing infinite playback. Attached MRE (audioloop-mre.c, generated with AI, reviewed myself) generates a do-re-mi tone (C4 -> D4 -> E4, 0.5 s each running once) and submits it via waveOutWrite with the reproducing flags. - build: `winegcc audioloop-mre.c -o audioloop-mre -lwinmm -lm` - expected: prints "WOM_DONE received" after ~1.5 s. - actual: do-re-mi loops continuously, times out after 10 s. A short disclaimer; on MSDN I couldn't find the proper behavior, since it doesn't even define what `dwLoops = 0` means at all. Though I'm certain that it should work as expected based on my prior experience with some concrete apps with which I'm having this trouble. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59874 nedsociety@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|winmm: infinite playback on |winmm: infinite playback |waveOutWrite with |when waveOutWrite with |WHDR_BEGINLOOP|WHDR_ENDLOOP |WHDR_BEGINLOOP|WHDR_ENDLOOP |and dwLoops=0 |and dwLoops=0 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla