[PATCH 3/4] quartz/dsoundrender: Clear the DirectSound buffer on EOS.

Zebediah Figura z.figura12 at gmail.com
Thu Jul 23 19:29:23 CDT 2020


"Zero Escape: Nine Hours, Nine Persons, Nine Doors" does not stop or destroy the
graph after it is finished running, so the last second of audio repeats
otherwise.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/quartz/dsoundrender.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c
index a3155477fde..8b914751e15 100644
--- a/dlls/quartz/dsoundrender.c
+++ b/dlls/quartz/dsoundrender.c
@@ -477,6 +477,8 @@ static HRESULT dsound_render_sink_eos(struct strmbase_sink *iface)
     struct dsound_render *filter = impl_from_strmbase_pin(&iface->pin);
     IFilterGraph *graph = filter->filter.graph;
     IMediaEventSink *event_sink;
+    void *buffer;
+    DWORD size;
 
     EnterCriticalSection(&filter->stream_cs);
 
@@ -494,6 +496,10 @@ static HRESULT dsound_render_sink_eos(struct strmbase_sink *iface)
 
     DSoundRender_HandleEndOfStream(filter);
 
+    IDirectSoundBuffer_Lock(filter->dsbuffer, 0, 0, &buffer, &size, NULL, NULL, DSBLOCK_ENTIREBUFFER);
+    memset(buffer, 0, size);
+    IDirectSoundBuffer_Unlock(filter->dsbuffer, buffer, size, NULL, 0);
+
     LeaveCriticalSection(&filter->stream_cs);
     return S_OK;
 }
-- 
2.27.0




More information about the wine-devel mailing list