videodecoder: do not lose events when dropping frames
authorThiago Santos <ts.santos@sisa.samsung.com>
Sat, 11 Jan 2014 04:24:44 +0000 (01:24 -0300)
committerThiago Santos <ts.santos@sisa.samsung.com>
Mon, 13 Jan 2014 09:11:09 +0000 (06:11 -0300)
Events must be persisted after a frame is dropped to avoid
losing obligatory information for the stream.

https://bugzilla.gnome.org/show_bug.cgi?id=721835

gst-libs/gst/video/gstvideodecoder.c

index 3565fa8..a1533d0 100644 (file)
@@ -2461,6 +2461,11 @@ gst_video_decoder_release_frame (GstVideoDecoder * dec,
     gst_video_codec_frame_unref (frame);
     dec->priv->frames = g_list_delete_link (dec->priv->frames, link);
   }
+  if (frame->events) {
+    dec->priv->pending_events =
+        g_list_concat (dec->priv->pending_events, frame->events);
+    frame->events = NULL;
+  }
   GST_VIDEO_DECODER_STREAM_UNLOCK (dec);
 
   /* unref because this function takes ownership */