Commit 962e1153 authored by Thomas Guillem's avatar Thomas Guillem Committed by Steve Lhomme
Browse files

thumbnailer: remove task before notifying it

This fixes a task that could be notified 2 times (valid pic +
cancelled) if libvlc is released just after a thumbnail request.
parent a3bd2361
......@@ -192,7 +192,7 @@ RunnableRun(void *userdata)
input_Create( thumbnailer->parent, on_thumbnailer_input_event, task,
task->item, INPUT_TYPE_THUMBNAILING, NULL, NULL );
if (!input)
goto end;
goto error;
if (task->seek_target.type == VLC_THUMBNAILER_SEEK_TIME)
input_SetTime(input, task->seek_target.time, task->fast_seek);
......@@ -206,7 +206,7 @@ RunnableRun(void *userdata)
if (ret != VLC_SUCCESS)
{
input_Close(input);
goto end;
goto error;
}
vlc_mutex_lock(&task->lock);
......@@ -229,6 +229,8 @@ RunnableRun(void *userdata)
bool notify = task->status != INTERRUPTED;
vlc_mutex_unlock(&task->lock);
ThumbnailerRemoveTask(thumbnailer, task);
if (notify)
NotifyThumbnail(task, pic);
......@@ -238,7 +240,10 @@ RunnableRun(void *userdata)
input_Stop(input);
input_Close(input);
end:
TaskDelete(task);
return;
error:
ThumbnailerRemoveTask(thumbnailer, task);
TaskDelete(task);
}
......
Supports Markdown
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