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

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: '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 4e50b617
......@@ -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;
......
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