From 79129db1cdcb3117bc24f02c5d4a219bb9e28e0f Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Thu, 23 Jul 2020 19:29:23 -0500 Subject: [PATCH] quartz/dsoundrender: Clear the DirectSound buffer on EOS. "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 Signed-off-by: Alexandre Julliard --- 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; }