summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.net>2006-10-29 19:08:01 +0000
committerTim-Philipp Müller <tim@centricular.net>2006-10-29 19:08:01 +0000
commitbd2497729e65a160c2453af996d2802e399132e9 (patch)
tree25a3194204eda2cebe049aff5cada5c867b89c64
parent3ffdbb0d7ae6c1d78933bc3227508c9fcdfdc624 (diff)
downloadgst-plugins-bad-bd2497729e65a160c2453af996d2802e399132e9.tar.gz
gst-plugins-bad-bd2497729e65a160c2453af996d2802e399132e9.tar.bz2
gst-plugins-bad-bd2497729e65a160c2453af996d2802e399132e9.zip
ext/dts/gstdtsdec.c: Fix flow handling and buffer refcounting (gst_pad_push() takes ownership of the buffer passed to...
Original commit message from CVS: * ext/dts/gstdtsdec.c: (gst_dtsdec_handle_frame): Fix flow handling and buffer refcounting (gst_pad_push() takes ownership of the buffer passed to it, the buffer does not have to be unreffed no matter what flow value gst_pad_push() returns).
-rw-r--r--ChangeLog7
-rw-r--r--ext/dts/gstdtsdec.c16
2 files changed, 11 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 22856559..8b46e244 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-10-29 Tim-Philipp Müller <tim at centricular dot net>
+
+ * ext/dts/gstdtsdec.c: (gst_dtsdec_handle_frame):
+ Fix flow handling and buffer refcounting (gst_pad_push() takes
+ ownership of the buffer passed to it, the buffer does not have
+ to be unreffed no matter what flow value gst_pad_push() returns).
+
2006-10-26 Edgard Lima <edgard.lima@indt.org.br>
Patch by: Renato Filho <renato.filho@indt.org.br>
diff --git a/ext/dts/gstdtsdec.c b/ext/dts/gstdtsdec.c
index 6b913dc6..c2b3329c 100644
--- a/ext/dts/gstdtsdec.c
+++ b/ext/dts/gstdtsdec.c
@@ -435,10 +435,8 @@ gst_dtsdec_handle_frame (GstDtsDec * dts, guint8 * data,
result = gst_pad_alloc_buffer_and_set_caps (dts->srcpad, 0,
(SAMPLE_WIDTH / 8) * 256 * num_c, GST_PAD_CAPS (dts->srcpad), &out);
- if (result != GST_FLOW_OK) {
- GST_ELEMENT_ERROR (dts, RESOURCE, FAILED, (NULL), ("Out of memory"));
- goto done;
- }
+ if (result != GST_FLOW_OK)
+ break;
GST_BUFFER_TIMESTAMP (out) = dts->current_ts;
GST_BUFFER_DURATION (out) = GST_SECOND * 256 / dts->sample_rate;
@@ -457,16 +455,10 @@ gst_dtsdec_handle_frame (GstDtsDec * dts, guint8 * data,
/* push on */
result = gst_pad_push (dts->srcpad, out);
- if (result != GST_FLOW_OK) {
- gst_buffer_unref (out);
- goto done;
- }
-
-
+ if (result != GST_FLOW_OK)
+ break;
}
-done:
-
return result;
}