This was used to implement IReferenceClock::GetTime(), which was reimplemented
in 63a6b308e9.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Fixes audio stuttering during video playback in multiple games (e.g.
Commandos 2, Alien Nations, Dino Crisis Demo).
Signed-off-by: Anton Baskanov <baskanov@gmail.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
We don't grab stream_cs to change any variables checked here, except to reset
flush_event, and that cannot result in a deadlock.
The only possible deadlocks here are:
(1) between this function and EndOfStream(), which is correct, as the two
should presumably be serialized;
(2) between this function and EndFlush(); however, in that case we expect
BeginFlush() first, which will unblock the streaming thread.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
We don't grab stream_cs to change any variables checked here, except to reset
flush_event, and that cannot result in a deadlock.
The only possible deadlocks here are:
(1) between this function and Receive(), which is correct, as the two
should presumably be serialized;
(2) between this function and EndFlush(); however, in that case we expect
BeginFlush() first, which will unblock the streaming thread.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
"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>
The DirectSound renderer does a lot of things differently. To a large degree
this is to be expected; it's an audio renderer and therefore needs to buffer
much farther in advance. However, it also doesn't participate in quality
management, doesn't block in Receive(), and has a few other mild differences in
behaviour. Weighing the features implemented by the base renderer against the
quirks necessary for the DirectSound renderer leads me to believe that it would
be easier not to use that framework.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
For several reasons.
Firstly, the reference clock should still function when the filter is not
running.
Secondly, IDirectSoundBuffer::GetPositions() in practice returns very coarse
positions, both on Windows and on Wine. On my hardware, the resolution is
about 10ms, which, while suitable for the DirectSound renderer and probably
also any video renderers, is nevertheless actually coarser than
GetTickCount().
Thirdly, testing supports that the native DirectSound renderer returns a
timestamp from IReferenceClock::GetTime() that is more accurate than
IDirectSoundBuffer::GetPositions(). In fact, after dumping a large number of
different clock sources, I came to the conclusion that it is probably using
timeGetTime() as a source. On Wine that's identical to GetTickCount(), so we
may as well just delegate directly to the system clock.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
IPin::EndOfStream() is called from a streaming thread. The streaming thread
should never take the filter lock.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Only renderers should ever need to care about this.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>