videodecoder: keep event order

Since events are pushed out in reverse order, newer events need to
be added at the front of event lists

https://bugzilla.gnome.org/show_bug.cgi?id=794192
This commit is contained in:
Matthias Fend 2018-03-08 11:28:58 +01:00 committed by Nicolas Dufresne
parent 56ab7e0e1d
commit 41c6efb9ff

View file

@ -2629,7 +2629,7 @@ gst_video_decoder_prepare_finish_frame (GstVideoDecoder *
GstVideoCodecFrame *tmp = l->data;
if (tmp->events) {
events = g_list_concat (events, tmp->events);
events = g_list_concat (tmp->events, events);
tmp->events = NULL;
}
@ -2640,7 +2640,7 @@ gst_video_decoder_prepare_finish_frame (GstVideoDecoder *
if (dropping || !decoder->priv->output_state) {
/* Push before the next frame that is not dropped */
decoder->priv->pending_events =
g_list_concat (decoder->priv->pending_events, events);
g_list_concat (events, decoder->priv->pending_events);
} else {
gst_video_decoder_push_event_list (decoder, decoder->priv->pending_events);
decoder->priv->pending_events = NULL;
@ -2822,7 +2822,7 @@ gst_video_decoder_release_frame (GstVideoDecoder * dec,
}
if (frame->events) {
dec->priv->pending_events =
g_list_concat (dec->priv->pending_events, frame->events);
g_list_concat (frame->events, dec->priv->pending_events);
frame->events = NULL;
}
GST_VIDEO_DECODER_STREAM_UNLOCK (dec);