Module: wine Branch: master Commit: 79129db1cdcb3117bc24f02c5d4a219bb9e28e0f URL: https://source.winehq.org/git/wine.git/?a=commit;h=79129db1cdcb3117bc24f02c5...
Author: Zebediah Figura z.figura12@gmail.com Date: Thu Jul 23 19:29:23 2020 -0500
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 z.figura12@gmail.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/quartz/dsoundrender.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index a3155477fd..8b914751e1 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; }