[oe-commits] ghost : gst-plugins-good_0.10.15.bb: backport matroskademux memleak fix

git version control git at git.openembedded.org
Thu Jun 25 11:04:21 UTC 2009


Module: openembedded.git
Branch: org.openembedded.dreambox
Commit: 513aca2c11a757fc9207895bb9b89434997ba029
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=513aca2c11a757fc9207895bb9b89434997ba029

Author: ghost <andreas.monzner at multimedia-labs.de>
Date:   Tue Jun 23 16:59:07 2009 +0200

gst-plugins-good_0.10.15.bb: backport matroskademux memleak fix

---

 .../backport_matroskademux_memleak_fix.patch       |   86 ++++++++++++++++++++
 packages/gstreamer/gst-plugins-good_0.10.15.bb     |    6 +-
 2 files changed, 90 insertions(+), 2 deletions(-)

diff --git a/packages/gstreamer/gst-plugins-good/backport_matroskademux_memleak_fix.patch b/packages/gstreamer/gst-plugins-good/backport_matroskademux_memleak_fix.patch
new file mode 100644
index 0000000..d4edc88
--- /dev/null
+++ b/packages/gstreamer/gst-plugins-good/backport_matroskademux_memleak_fix.patch
@@ -0,0 +1,86 @@
+From 9600c549380d97f79e7a948a3367962405c93f05 Mon Sep 17 00:00:00 2001
+From: Wim Taymans <wim.taymans at collabora.co.uk>
+Date: Tue, 23 Jun 2009 10:42:33 +0000
+Subject: matroskademux: avoid leaking buffers
+
+Don't leak buffers when resyncing to a keyframe.
+Avoid leaking buffers when exiting the loop on error conditions.
+Add some more debug info.
+
+Fixes #585911
+---
+diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c
+index 5c12482..0737175 100644
+--- a/gst/matroska/matroska-demux.c
++++ b/gst/matroska/matroska-demux.c
+@@ -873,6 +873,8 @@ gst_matroska_decode_buffer (GstMatroskaTrackContext * context, GstBuffer * buf)
+ 
+   g_return_val_if_fail (GST_IS_BUFFER (buf), NULL);
+ 
++  GST_DEBUG ("decoding buffer %p", buf);
++
+   data = GST_BUFFER_DATA (buf);
+   size = GST_BUFFER_SIZE (buf);
+ 
+@@ -890,6 +892,7 @@ gst_matroska_decode_buffer (GstMatroskaTrackContext * context, GstBuffer * buf)
+ 
+     return buf;
+   } else {
++    GST_DEBUG ("decode data failed");
+     gst_buffer_unref (buf);
+     return NULL;
+   }
+@@ -4010,6 +4013,10 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux,
+         guint64 num;
+         guint8 *data;
+ 
++        if (buf) {
++          gst_buffer_unref (buf);
++          buf = NULL;
++        }
+         if ((ret = gst_ebml_read_buffer (ebml, &id, &buf)) != GST_FLOW_OK)
+           break;
+ 
+@@ -4272,6 +4279,7 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux,
+ 
+       sub = gst_buffer_create_sub (buf,
+           GST_BUFFER_SIZE (buf) - size, lace_size[n]);
++      GST_WARNING_OBJECT (demux, "created subbuffer %p", sub);
+ 
+       if (stream->encodings != NULL && stream->encodings->len > 0)
+         sub = gst_matroska_decode_buffer (stream, sub);
+@@ -4301,7 +4309,6 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux,
+ 
+       gst_matroska_demux_sync_streams (demux);
+ 
+-
+       if (duration) {
+         GST_BUFFER_DURATION (sub) = duration / laces;
+         stream->pos += GST_BUFFER_DURATION (sub);
+@@ -4326,6 +4333,7 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux,
+         /* When doing seeks or such, we need to restart on key frames or
+          * decoders might choke. */
+         GST_DEBUG_OBJECT (demux, "skipping delta unit");
++        gst_buffer_unref (sub);
+         goto done;
+       }
+ 
+@@ -4361,6 +4369,7 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux,
+ 
+       /* Postprocess the buffers depending on the codec used */
+       if (stream->postprocess_frame) {
++        GST_LOG_OBJECT (demux, "running post process");
+         ret = stream->postprocess_frame (GST_ELEMENT (demux), stream, &sub);
+       }
+ 
+@@ -4378,7 +4387,7 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux,
+   }
+ 
+ done:
+-  if (readblock)
++  if (buf)
+     gst_buffer_unref (buf);
+   g_free (lace_size);
+ 
+--
+cgit v0.8.2
diff --git a/packages/gstreamer/gst-plugins-good_0.10.15.bb b/packages/gstreamer/gst-plugins-good_0.10.15.bb
index c8ffdf6..f1969f6 100644
--- a/packages/gstreamer/gst-plugins-good_0.10.15.bb
+++ b/packages/gstreamer/gst-plugins-good_0.10.15.bb
@@ -1,4 +1,6 @@
 require gst-plugins.inc
-SRC_URI += "file://sed-with-autoconf-2.59.patch;patch=1;pnum=1"
 DEPENDS += "gst-plugins-base"
-SRC_URI += "file://gst-plugins-good_configure_skip_shave.patch;patch=1;pnum=0"
\ No newline at end of file
+SRC_URI += "file://sed-with-autoconf-2.59.patch;patch=1;pnum=1 \
+	file://gst-plugins-good_configure_skip_shave.patch;patch=1;pnum=0 \
+	file://backport_matroskademux_memleak_fix.patch;patch=1;pnum=1"
+PR = "r2"
\ No newline at end of file





More information about the Openembedded-commits mailing list