Module: wine
Branch: master
Commit: f45c8fd2b8075fb2db72169d6c28af1ea000a047
URL: https://source.winehq.org/git/wine.git/?a=commit;h=f45c8fd2b8075fb2db72169d…
Author: Giovanni Mascellani <gmascellani(a)codeweavers.com>
Date: Wed Sep 22 13:18:38 2021 +0200
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(a)codeweavers.com>
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
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 a10ad998231..46cb94d4cde 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);
}
Module: wine
Branch: master
Commit: c9f0a3ce5c8eee2a0098df74b98208015843fa71
URL: https://source.winehq.org/git/wine.git/?a=commit;h=c9f0a3ce5c8eee2a0098df74…
Author: Giovanni Mascellani <gmascellani(a)codeweavers.com>
Date: Wed Sep 22 13:18:37 2021 +0200
winegstreamer/media_source: Emit absolute presentation timestamp.
Currently the media source emit a presentation timestamp relative to
when the playback was last restarted. I.e., the frame that sits two
seconds inside a media file will get timestamp 2 if playback was
started at the beginning of the file, but will get timestamp 1 if
playback was last restarted at second 1.
This does not match Windows behavior, where each frame always gets
the same timestamp independently from where playback was started.
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/winegstreamer/media_source.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c
index 825bad8da27..a10ad998231 100644
--- a/dlls/winegstreamer/media_source.c
+++ b/dlls/winegstreamer/media_source.c
@@ -100,8 +100,6 @@ struct media_source
SOURCE_SHUTDOWN,
} state;
- LONGLONG start_time;
-
HANDLE read_thread;
bool read_thread_shutdown;
};
@@ -274,7 +272,6 @@ static void start_pipeline(struct media_source *source, struct source_async_comm
position->vt = VT_I8;
position->hVal.QuadPart = 0;
}
- source->start_time = position->hVal.QuadPart;
for (i = 0; i < source->stream_count; i++)
{
@@ -427,7 +424,7 @@ static void send_buffer(struct media_stream *stream, const struct wg_parser_even
goto out;
}
- if (FAILED(hr = IMFSample_SetSampleTime(sample, event->u.buffer.pts - stream->parent_source->start_time)))
+ if (FAILED(hr = IMFSample_SetSampleTime(sample, event->u.buffer.pts)))
{
ERR("Failed to set sample time, hr %#x.\n", hr);
goto out;