summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2007-03-22 11:08:03 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2007-03-22 11:08:03 +0000
commit4586d0398e240e074977dfcf1f4a74d0ac5c17ad (patch)
tree148012adfb48824e5767ef4e20326794dbc1f11f
parent4f1ddeddbae60f12e652c96fc0cb65402c056fa8 (diff)
ext/wavpack/gstwavpackdec.c: Revert to use gst_pad_alloc_buffer() here. We can and should use it.
Original commit message from CVS: * ext/wavpack/gstwavpackdec.c: (gst_wavpack_dec_chain): Revert to use gst_pad_alloc_buffer() here. We can and should use it. Thanks to Jan and Mike for noticing my mistake.
-rw-r--r--ChangeLog6
-rw-r--r--ext/wavpack/gstwavpackdec.c12
2 files changed, 12 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 1c23c90c6..47c7d0f5d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2007-03-22 Sebastian Dröge <slomo@circular-chaos.org>
+ * ext/wavpack/gstwavpackdec.c: (gst_wavpack_dec_chain):
+ Revert to use gst_pad_alloc_buffer() here. We can and should use it.
+ Thanks to Jan and Mike for noticing my mistake.
+
+2007-03-22 Sebastian Dröge <slomo@circular-chaos.org>
+
* ext/wavpack/gstwavpackenc.c: (gst_wavpack_enc_class_init),
(gst_wavpack_enc_init), (gst_wavpack_enc_chain),
(gst_wavpack_enc_rewrite_first_block):
diff --git a/ext/wavpack/gstwavpackdec.c b/ext/wavpack/gstwavpackdec.c
index a20d5d05e..19171173a 100644
--- a/ext/wavpack/gstwavpackdec.c
+++ b/ext/wavpack/gstwavpackdec.c
@@ -359,14 +359,14 @@ gst_wavpack_dec_chain (GstPad * pad, GstBuffer * buf)
if (decoded != wph.block_samples)
goto decode_error;
- /* alloc output buffer. Can't use gst_pad_alloc_buffer() because of
- * possible clipping which will cause problems with BaseTransform
- * elements because of the unit size */
+ /* alloc output buffer */
unpacked_size = wph.block_samples * (dec->width / 8) * dec->channels;
- outbuf = gst_buffer_new_and_alloc (unpacked_size);
- gst_buffer_set_caps (outbuf, GST_PAD_CAPS (dec->srcpad));
+ ret = gst_pad_alloc_buffer (dec->srcpad, GST_BUFFER_OFFSET (buf),
+ unpacked_size, GST_PAD_CAPS (dec->srcpad), &outbuf);
+ if (ret != GST_FLOW_OK)
+ goto out;
- /* put samples into output buffer */
+ /* put samples into the output buffer */
gst_wavpack_dec_format_samples (dec, GST_BUFFER_DATA (outbuf),
unpack_buf, wph.block_samples);
gst_buffer_stamp (outbuf, buf);