Commit e351093a authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

wasapi: check IAudioClock::GetPosition for error

parent fb6c8449
......@@ -100,10 +100,15 @@ static void Play(audio_output_t *aout, block_t *block, mtime_t *restrict drift)
{
UINT64 pos, qpcpos;
IAudioClock_GetPosition(sys->clock, &pos, &qpcpos);
qpcpos = (qpcpos + 5) / 10; /* 100ns -> 1µs */
/* NOTE: this assumes mdate() uses QPC() (which it currently does). */
*drift = mdate() - qpcpos;
hr = IAudioClock_GetPosition(sys->clock, &pos, &qpcpos);
if (SUCCEEDED(hr))
{
qpcpos = (qpcpos + 5) / 10; /* 100ns -> 1µs */
*drift = mdate() - qpcpos;
}
else
msg_Warn(aout, "cannot get position (error 0x%lx)", hr);
}
for (;;)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment