Commit f45c8fd2 authored by Giovanni Mascellani's avatar Giovanni Mascellani Committed by Alexandre Julliard

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: 's avatarGiovanni Mascellani <gmascellani@codeweavers.com> Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent c9f0a3ce
...@@ -329,8 +329,9 @@ static void start_pipeline(struct media_source *source, struct source_async_comm ...@@ -329,8 +329,9 @@ static void start_pipeline(struct media_source *source, struct source_async_comm
source->state = SOURCE_RUNNING; source->state = SOURCE_RUNNING;
unix_funcs->wg_parser_stream_seek(source->streams[0]->wg_stream, 1.0, if (position->vt == VT_I8)
position->hVal.QuadPart, 0, AM_SEEKING_AbsolutePositioning, AM_SEEKING_NoPositioning); unix_funcs->wg_parser_stream_seek(source->streams[0]->wg_stream, 1.0,
position->hVal.QuadPart, 0, AM_SEEKING_AbsolutePositioning, AM_SEEKING_NoPositioning);
unix_funcs->wg_parser_end_flush(source->wg_parser); unix_funcs->wg_parser_end_flush(source->wg_parser);
} }
......
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