summaryrefslogtreecommitdiffstats
path: root/sys/directdraw/gstdirectdrawsink.c
diff options
context:
space:
mode:
authorOle André Vadla Ravnås <ole.andre.ravnas@tandberg.com>2008-08-21 15:28:09 +0000
committerTim-Philipp Müller <tim@centricular.net>2008-08-21 15:28:09 +0000
commit7f27287256656d14f269fb42f48c5e5a64f11d23 (patch)
tree1f447088d7c78426fd567e71794e1f340b3725a1 /sys/directdraw/gstdirectdrawsink.c
parent332f465dc36582685532872c5ef1f5b76976ed2a (diff)
sys/directdraw/gstdirectdrawsink.c: Fix buffer ref leak.
Original commit message from CVS: Patch by: Ole André Vadla Ravnås <ole.andre.ravnas at tandberg com> * sys/directdraw/gstdirectdrawsink.c: (gst_directdraw_sink_show_frame): Fix buffer ref leak.
Diffstat (limited to 'sys/directdraw/gstdirectdrawsink.c')
-rw-r--r--sys/directdraw/gstdirectdrawsink.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/directdraw/gstdirectdrawsink.c b/sys/directdraw/gstdirectdrawsink.c
index d0a318b7..18d6178e 100644
--- a/sys/directdraw/gstdirectdrawsink.c
+++ b/sys/directdraw/gstdirectdrawsink.c
@@ -800,12 +800,10 @@ gst_directdraw_sink_show_frame (GstBaseSink * bsink, GstBuffer * buf)
if (buf) {
/* save a reference to the input buffer */
- if (ddrawsink->last_buffer != buf) {
- if (ddrawsink->last_buffer) {
- gst_buffer_unref (ddrawsink->last_buffer);
- }
- }
- ddrawsink->last_buffer = gst_buffer_ref (buf);
+ gst_buffer_ref (buf);
+ if (ddrawsink->last_buffer != NULL)
+ gst_buffer_unref (ddrawsink->last_buffer);
+ ddrawsink->last_buffer = buf;
} else {
/* use last buffer */
buf = ddrawsink->last_buffer;