On 4/25/21 9:51 PM, Anton Baskanov wrote:
Fixes audio stuttering during video playback in multiple games (e.g. Commandos 2, Alien Nations, Dino Crisis Demo).
Can you please provide a +quartz,+strmbase,+gstreamer log that demonstrates the problem?
Signed-off-by: Anton Baskanov baskanov@gmail.com
dlls/quartz/dsoundrender.c | 5 +---- dlls/quartz/tests/dsoundrender.c | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index 6c6732e468a..f7f0255d4ab 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -149,7 +149,6 @@ static void DSoundRender_UpdatePositions(struct dsound_render *This, DWORD *seqw static HRESULT DSoundRender_GetWritePos(struct dsound_render *This, DWORD *ret_writepos, REFERENCE_TIME write_at, DWORD *pfree, DWORD *skip) {
- WAVEFORMATEX *wfx = (WAVEFORMATEX *)This->sink.pin.mt.pbFormat; DWORD writepos, min_writepos, playpos; REFERENCE_TIME max_lag = 50 * 10000; REFERENCE_TIME cur, writepos_t, delta_t;
@@ -212,10 +211,8 @@ static HRESULT DSoundRender_GetWritePos(struct dsound_render *This, *ret_writepos = (min_writepos + aheadbytes) % This->buf_size; } end:
- if (playpos > *ret_writepos)
- if (playpos >= *ret_writepos) *pfree = playpos - *ret_writepos;
- else if (playpos == *ret_writepos)
*pfree = This->buf_size - wfx->nBlockAlign; else *pfree = This->buf_size + playpos - *ret_writepos; if (time_from_pos(This, This->buf_size - *pfree) >= DSoundRenderer_Max_Fill) {
diff --git a/dlls/quartz/tests/dsoundrender.c b/dlls/quartz/tests/dsoundrender.c index c33c074d93d..e591e1832d5 100644 --- a/dlls/quartz/tests/dsoundrender.c +++ b/dlls/quartz/tests/dsoundrender.c @@ -737,7 +737,7 @@ static HRESULT send_frame(IMemInputPin *sink) params->sink = sink; params->sample = sample; thread = CreateThread(NULL, 0, frame_thread, params, 0, NULL);
- ret = WaitForSingleObject(thread, 500);
- ret = WaitForSingleObject(thread, 2000); todo_wine_if (ret) ok(!ret, "Wait failed.\n"); GetExitCodeThread(thread, &ret); CloseHandle(thread);