mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 19:31:12 +00:00
basevideodecoder: fix weird event list handling
Get rid of weird code that copies a list manually, taking ownership of the elements and then frees the old list. Instead, just take over the old list entirely. (If the intent was to reverse the list, one could use g_list_reverse() instead). Then, push events in the list out from last to first (since they were prepended as they came in) instead of just pushing out the last in the list and leaking the others.
This commit is contained in:
parent
217ac7b3be
commit
f1bbb0f8a4
1 changed files with 2 additions and 6 deletions
|
@ -1405,11 +1405,7 @@ gst_base_video_decoder_finish_frame (GstBaseVideoDecoder * base_video_decoder,
|
|||
GstVideoFrame *tmp = l->data;
|
||||
|
||||
if (tmp->events) {
|
||||
GList *k;
|
||||
|
||||
for (k = g_list_last (tmp->events); k; k = k->prev)
|
||||
events = g_list_prepend (events, k->data);
|
||||
g_list_free (tmp->events);
|
||||
events = tmp->events;
|
||||
tmp->events = NULL;
|
||||
}
|
||||
|
||||
|
@ -1417,7 +1413,7 @@ gst_base_video_decoder_finish_frame (GstBaseVideoDecoder * base_video_decoder,
|
|||
break;
|
||||
}
|
||||
|
||||
for (l = g_list_last (events); l; l = l->next)
|
||||
for (l = g_list_last (events); l; l = l->prev)
|
||||
gst_pad_push_event (GST_BASE_VIDEO_CODEC_SRC_PAD (base_video_decoder),
|
||||
l->data);
|
||||
g_list_free (events);
|
||||
|
|
Loading…
Reference in a new issue