winegstreamer/media_source: Only seek if it was requested by the caller.
commitf45c8fd2b8075fb2db72169d6c28af1ea000a047
authorGiovanni Mascellani <gmascellani@codeweavers.com>
Wed, 22 Sep 2021 11:18:38 +0000 (22 13:18 +0200)
committerAlexandre Julliard <julliard@winehq.org>
Mon, 27 Sep 2021 18:37:48 +0000 (27 20:37 +0200)
tree73b1d4b9bf7d68638fab6f920bd4c7796768a399
parentc9f0a3ce5c8eee2a0098df74b98208015843fa71
winegstreamer/media_source: Only seek if it was requested by the caller.

When starting a media source, the caller can specify a timestamp to seek
to by mean of a PROPVARIANT argument. If the PROPVARIANT is empty, then
no seek operation has to take place: playback has to either restart from
the beginning (if the media source was previously in stopped state) or
from where it was left (if the media source was in paused state).

Also, when a PROPVARIANT is empty it is a bug to use its content, because
there is no guarantee that it is initialized to a sensible value.

This patch fixes both bugs by gating the seek operation with the check
that the PROPVARIANT has the right type.

Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
dlls/winegstreamer/media_source.c