Author: janderwald
Date: Sun Jan 31 20:09:30 2010
New Revision: 45360
URL:
http://svn.reactos.org/svn/reactos?rev=45360&view=rev
Log:
[MMEBUDDY]
- Hackfix corruption of audio buffer list which made the playback thread spin forever on
an already played buffer.
- Tested with Winamp / VLC / mplay32 with Vbox 3.1.2
Modified:
trunk/reactos/lib/drivers/sound/mmebuddy/wave/header.c
trunk/reactos/lib/drivers/sound/mmebuddy/wave/streaming.c
Modified: trunk/reactos/lib/drivers/sound/mmebuddy/wave/header.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
==============================================================================
--- trunk/reactos/lib/drivers/sound/mmebuddy/wave/header.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/sound/mmebuddy/wave/header.c [iso-8859-1] Sun Jan 31
20:09:30 2010
@@ -248,10 +248,18 @@
{
/* There are already queued headers - make this one the tail */
SND_TRACE(L"Enqueued next wave header\n");
- SoundDeviceInstance->TailWaveHeader->lpNext = WaveHeader;
- SoundDeviceInstance->TailWaveHeader = WaveHeader;
-
- DoWaveStreaming(SoundDeviceInstance);
+
+ /* FIXME - Make sure that the buffer has not already been added to the list */
+ if ( SoundDeviceInstance->TailWaveHeader != WaveHeader )
+ {
+ SND_ASSERT(SoundDeviceInstance->TailWaveHeader != WaveHeader);
+
+ SoundDeviceInstance->TailWaveHeader->lpNext = WaveHeader;
+ SoundDeviceInstance->TailWaveHeader = WaveHeader;
+ DUMP_WAVEHDR_QUEUE(SoundDeviceInstance);
+
+ DoWaveStreaming(SoundDeviceInstance);
+ }
}
DUMP_WAVEHDR_QUEUE(SoundDeviceInstance);
Modified: trunk/reactos/lib/drivers/sound/mmebuddy/wave/streaming.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
==============================================================================
--- trunk/reactos/lib/drivers/sound/mmebuddy/wave/streaming.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/sound/mmebuddy/wave/streaming.c [iso-8859-1] Sun Jan 31
20:09:30 2010
@@ -77,6 +77,7 @@
{
{
/* Move on to the next header */
+ SND_ASSERT(Header != Header->lpNext);
Header = Header->lpNext;
}
}
@@ -209,9 +210,9 @@
}
else
{
- SND_TRACE(L"%d/%d bytes of wavehdr completed\n",
HdrExtension->BytesCompleted, WaveHdr->dwBufferLength);
/* Partially completed */
HdrExtension->BytesCompleted += dwNumberOfBytesTransferred;
+ SND_TRACE(L"%d/%d bytes of wavehdr completed\n",
HdrExtension->BytesCompleted, WaveHdr->dwBufferLength);
break;
}