mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 05:59:10 +00:00
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).
This commit is contained in:
parent
3ffdbb0d7a
commit
bd2497729e
2 changed files with 11 additions and 12 deletions
|
@ -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>
|
2006-10-26 Edgard Lima <edgard.lima@indt.org.br>
|
||||||
|
|
||||||
Patch by: Renato Filho <renato.filho@indt.org.br>
|
Patch by: Renato Filho <renato.filho@indt.org.br>
|
||||||
|
|
|
@ -435,10 +435,8 @@ gst_dtsdec_handle_frame (GstDtsDec * dts, guint8 * data,
|
||||||
result = gst_pad_alloc_buffer_and_set_caps (dts->srcpad, 0,
|
result = gst_pad_alloc_buffer_and_set_caps (dts->srcpad, 0,
|
||||||
(SAMPLE_WIDTH / 8) * 256 * num_c, GST_PAD_CAPS (dts->srcpad), &out);
|
(SAMPLE_WIDTH / 8) * 256 * num_c, GST_PAD_CAPS (dts->srcpad), &out);
|
||||||
|
|
||||||
if (result != GST_FLOW_OK) {
|
if (result != GST_FLOW_OK)
|
||||||
GST_ELEMENT_ERROR (dts, RESOURCE, FAILED, (NULL), ("Out of memory"));
|
break;
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (out) = dts->current_ts;
|
GST_BUFFER_TIMESTAMP (out) = dts->current_ts;
|
||||||
GST_BUFFER_DURATION (out) = GST_SECOND * 256 / dts->sample_rate;
|
GST_BUFFER_DURATION (out) = GST_SECOND * 256 / dts->sample_rate;
|
||||||
|
@ -457,16 +455,10 @@ gst_dtsdec_handle_frame (GstDtsDec * dts, guint8 * data,
|
||||||
/* push on */
|
/* push on */
|
||||||
result = gst_pad_push (dts->srcpad, out);
|
result = gst_pad_push (dts->srcpad, out);
|
||||||
|
|
||||||
if (result != GST_FLOW_OK) {
|
if (result != GST_FLOW_OK)
|
||||||
gst_buffer_unref (out);
|
break;
|
||||||
goto done;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
done:
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue