From: Giovanni Mascellani Subject: Re: [PATCH 2/7] winegstreamer: Only seek if it was requested by the caller. Message-Id: <431e6ef2-41a0-5202-56ba-4b3cdfa0ef50@codeweavers.com> Date: Fri, 17 Sep 2021 16:48:51 +0200 In-Reply-To: <20210906151109.225515-2-gmascellani@codeweavers.com> References: <20210906151109.225515-1-gmascellani@codeweavers.com> <20210906151109.225515-2-gmascellani@codeweavers.com> Hi, when a Start command is issued to a media source, the caller can optionally specify a timestamp to seek to just before starting playback. This is expressed by mean of a PROPVARIANT, which can be empty if no seek is desired, or can be set to 64 bit int, which is interpreted at the timestamp to seek to. When no seek is requested, the playback will restart from the beginning if it was previously stopped, or from where it was if it was previously paused. The current version doesn't check the type of the PROPVARIANT before using it. This is a bug, both because the content of an empty PROPVARIANT is not specified and should therefore not be used, and because supplying an empty PROPVARIANT explicitly has the meaning of not requesting any seek. This patch fixes this bug by simply gating the seek with the check that the PROPVARIANT has the right type. Again, you can use patches 4/7 through 7/7 to test this one. See my explanation for 1/7. Giovanni. Il 06/09/21 17:11, Giovanni Mascellani ha scritto: > Signed-off-by: Giovanni Mascellani > --- > dlls/winegstreamer/media_source.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c > index cd8957db7b1..51ef84bf88f 100644 > --- a/dlls/winegstreamer/media_source.c > +++ b/dlls/winegstreamer/media_source.c > @@ -329,8 +329,9 @@ static void start_pipeline(struct media_source *source, struct source_async_comm > > source->state = SOURCE_RUNNING; > > - unix_funcs->wg_parser_stream_seek(source->streams[0]->wg_stream, 1.0, > - position->hVal.QuadPart, 0, AM_SEEKING_AbsolutePositioning, AM_SEEKING_NoPositioning); > + if (position->vt == VT_I8) > + 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); > } > >