[PATCH] widClose (wineoss/audio.c) sometimes fails...

James Hatheway james at macadamian.com
Fri Mar 23 15:36:14 CST 2001


Hi,

This bug is a little bit tricky.  What was happening was when I
was repeatedly recording audio in my app, and clicking stop, sometimes
an error was occuring on the stop and causing recording audio to not work
anymore.  What was happening basically is this:  In wineoss/audio.c's widReset
(called sometime after the app tells MCI to stop recording) it notifies the
client with all remaining buffers in the queue.  MCI receives this
notification (in WAVE_mciRecordCallback()), and writes out its data to disk
using mmioWrite, and then calls waveInAddBuffer with a new buffer (in order to
queue up another buffer)  This is fine if we are still recording, but we are
now stopped!  Anyway, this gets added to the queue (wwi->lpQueuePtr assigned a
value in wineoss/audio.c), and when widClose is called, it fails... sometimes..
since wwi->lpQueuePtr isn't NULL.  However, depending on the timing, sometimes
waveInAddBuffer isn't finished before the close is called; if that happens
it works fine, otherwise the close fails.... The fix is that WAVE_mciRecordCallback
should NOT queue up another buffer if we know that recording has stopped.

Changelog:
  James Hatheway - james at macadamian.com
  widClose() is sometimes failing... MCI (in WAVE_mciRecordCallback) shouldn't queue
  up buffers if it knows we are no longer recording.

Modified:
  dlls/winmm/mciwave/mciwave.c


--
James Hatheway
Software Designer - Macadamian Technologies, Inc.
james at macadamian.com ~ http://www.macadamian.com

  "Man könnte froh sein, wenn die Luft so rein wäre wie das Bier"
  "One could be happy if the air were as pure as the beer"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: widClose_fix.diff
Type: application/octet-stream
Size: 1104 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20010323/4c7aa380/widClose_fix.obj


More information about the wine-patches mailing list