[gst-cvs] gst-plugins-bad: vdpauh264dec: free frames on finalize in GstH264DPB

Carl-Anton Ingmarsson satis at kemper.freedesktop.org
Mon Jun 28 02:12:21 PDT 2010


Module: gst-plugins-bad
Branch: master
Commit: 7274d9f1423a20f140e270f5a43edb6ddc8708b2
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=7274d9f1423a20f140e270f5a43edb6ddc8708b2

Author: Carl-Anton Ingmarsson <ca.ingmarsson at gmail.com>
Date:   Sun Jun 27 10:52:33 2010 +0200

vdpauh264dec: free frames on finalize in GstH264DPB

---

 sys/vdpau/h264/gsth264dpb.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/sys/vdpau/h264/gsth264dpb.c b/sys/vdpau/h264/gsth264dpb.c
index 6d75d58..11a7d2c 100644
--- a/sys/vdpau/h264/gsth264dpb.c
+++ b/sys/vdpau/h264/gsth264dpb.c
@@ -49,8 +49,8 @@ gst_h264_dpb_fill_reference_frames (GstH264DPB * dpb,
     GstH264Frame *frame = frames[i];
 
     reference_frames[i].surface =
-        GST_VDP_VIDEO_BUFFER (GST_VIDEO_FRAME_CAST (frame)->
-        src_buffer)->surface;
+        GST_VDP_VIDEO_BUFFER (GST_VIDEO_FRAME_CAST (frame)->src_buffer)->
+        surface;
 
     reference_frames[i].is_long_term = frame->is_long_term;
     reference_frames[i].top_is_reference = frame->is_reference;
@@ -373,7 +373,13 @@ gst_h264_dpb_set_property (GObject * object, guint property_id,
 static void
 gst_h264_dpb_finalize (GObject * object)
 {
-  /* TODO: Add deinitalization code here */
+  GstH264DPB *dpb = GST_H264_DPB (object);
+  GstVideoFrame **frames;
+  guint i;
+
+  frames = (GstVideoFrame **) dpb->frames;
+  for (i = 0; i < dpb->n_frames; i++)
+    gst_video_frame_unref (frames[i]);
 
   G_OBJECT_CLASS (gst_h264_dpb_parent_class)->finalize (object);
 }





More information about the Gstreamer-commits mailing list