mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 03:01:03 +00:00
Don't queue multiple timeouts for delayed seeking
This commit is contained in:
parent
3123532841
commit
5ad29d568e
1 changed files with 6 additions and 4 deletions
|
@ -145,11 +145,13 @@ static void execute_seek (gint64 desired_position, CustomData *data) {
|
|||
if (GST_CLOCK_TIME_IS_VALID (data->last_seek_time) && diff < 500 * GST_MSECOND) {
|
||||
GSource *timeout_source;
|
||||
|
||||
data->desired_position = desired_position;
|
||||
if (!GST_CLOCK_TIME_IS_VALID (data->desired_position)) {
|
||||
timeout_source = g_timeout_source_new (diff / GST_MSECOND);
|
||||
g_source_attach (timeout_source, data->context);
|
||||
g_source_set_callback (timeout_source, (GSourceFunc)delayed_seek_cb, data, NULL);
|
||||
g_source_unref (timeout_source);
|
||||
}
|
||||
data->desired_position = desired_position;
|
||||
GST_DEBUG ("Throttling seek to %" GST_TIME_FORMAT ", will be in %" GST_TIME_FORMAT,
|
||||
GST_TIME_ARGS (desired_position), GST_TIME_ARGS (500 * GST_MSECOND - diff));
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue