videoencoder: Keep sticky events around when doing a soft reset

The current code will first discard all frames, and then tries to copy
all sticky events from the (now discarded) frames. Let's change the order.

https://bugzilla.gnome.org/show_bug.cgi?id=746865
This commit is contained in:
Song Bing 2015-03-27 13:39:43 +08:00 committed by Sebastian Dröge
parent 8b0329c45d
commit 992101f82a

View file

@ -340,10 +340,6 @@ gst_video_encoder_reset (GstVideoEncoder * encoder, gboolean hard)
priv->drained = TRUE;
g_list_foreach (priv->frames, (GFunc) gst_video_codec_frame_unref, NULL);
g_list_free (priv->frames);
priv->frames = NULL;
priv->bytes = 0;
priv->time = 0;
@ -389,6 +385,10 @@ gst_video_encoder_reset (GstVideoEncoder * encoder, gboolean hard)
encoder->priv->current_frame_events);
}
g_list_foreach (priv->frames, (GFunc) gst_video_codec_frame_unref, NULL);
g_list_free (priv->frames);
priv->frames = NULL;
GST_VIDEO_ENCODER_STREAM_UNLOCK (encoder);
return ret;