Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame^] | 1 | From c3f7d36b992a3cbcee3386dea85720f3cb04e1ff Mon Sep 17 00:00:00 2001 |
| 2 | From: Song Bing <b06498@freescale.com> |
| 3 | Date: Fri, 27 Mar 2015 13:39:43 +0800 |
| 4 | Subject: [PATCH] videoencoder: Keep sticky events around when doing a soft |
| 5 | reset |
| 6 | |
| 7 | The current code will first discard all frames, and then tries to copy |
| 8 | all sticky events from the (now discarded) frames. Let's change the order. |
| 9 | |
| 10 | https://bugzilla.gnome.org/show_bug.cgi?id=746865 |
| 11 | |
| 12 | Upstream-Status: Accepted |
| 13 | |
| 14 | --- |
| 15 | gst-libs/gst/video/gstvideoencoder.c | 8 ++++---- |
| 16 | 1 file changed, 4 insertions(+), 4 deletions(-) |
| 17 | |
| 18 | diff --git a/gst-libs/gst/video/gstvideoencoder.c b/gst-libs/gst/video/gstvideoencoder.c |
| 19 | index 614ba2d..4c5b111 100644 |
| 20 | --- a/gst-libs/gst/video/gstvideoencoder.c |
| 21 | +++ b/gst-libs/gst/video/gstvideoencoder.c |
| 22 | @@ -340,10 +340,6 @@ gst_video_encoder_reset (GstVideoEncoder * encoder, gboolean hard) |
| 23 | |
| 24 | priv->drained = TRUE; |
| 25 | |
| 26 | - g_list_foreach (priv->frames, (GFunc) gst_video_codec_frame_unref, NULL); |
| 27 | - g_list_free (priv->frames); |
| 28 | - priv->frames = NULL; |
| 29 | - |
| 30 | priv->bytes = 0; |
| 31 | priv->time = 0; |
| 32 | |
| 33 | @@ -392,6 +388,10 @@ gst_video_encoder_reset (GstVideoEncoder * encoder, gboolean hard) |
| 34 | encoder->priv->current_frame_events); |
| 35 | } |
| 36 | |
| 37 | + g_list_foreach (priv->frames, (GFunc) gst_video_codec_frame_unref, NULL); |
| 38 | + g_list_free (priv->frames); |
| 39 | + priv->frames = NULL; |
| 40 | + |
| 41 | GST_VIDEO_ENCODER_STREAM_UNLOCK (encoder); |
| 42 | |
| 43 | return ret; |
| 44 | -- |
| 45 | 1.7.9.5 |
| 46 | |