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>
This commit is contained in:
Zebediah Figura 2020-07-23 19:29:23 -05:00 committed by Alexandre Julliard
parent e707578007
commit 79129db1cd
1 changed files with 6 additions and 0 deletions

View File

@ -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;
}