mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 04:36:20 +00:00
libs/gst/base/gstbasetransform.c: Properly set the last_stop position on GstSegment. This will only happen if there i...
Original commit message from CVS: * libs/gst/base/gstbasetransform.c: (gst_base_transform_chain): Properly set the last_stop position on GstSegment. This will only happen if there is a buffer to push out.
This commit is contained in:
parent
1d16f949be
commit
c086db87a3
2 changed files with 20 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2007-05-03 Edward Hervey <edward@fluendo.com>
|
||||||
|
|
||||||
|
* libs/gst/base/gstbasetransform.c: (gst_base_transform_chain):
|
||||||
|
Properly set the last_stop position on GstSegment. This will only happen
|
||||||
|
if there is a buffer to push out.
|
||||||
|
|
||||||
2007-05-03 Wim Taymans <wim@fluendo.com>
|
2007-05-03 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
* libs/gst/base/gstbasetransform.c:
|
* libs/gst/base/gstbasetransform.c:
|
||||||
|
|
|
@ -1566,10 +1566,19 @@ gst_base_transform_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
{
|
{
|
||||||
GstBaseTransform *trans;
|
GstBaseTransform *trans;
|
||||||
GstFlowReturn ret;
|
GstFlowReturn ret;
|
||||||
|
GstClockTime last_stop = GST_CLOCK_TIME_NONE;
|
||||||
GstBuffer *outbuf = NULL;
|
GstBuffer *outbuf = NULL;
|
||||||
|
|
||||||
trans = GST_BASE_TRANSFORM (gst_pad_get_parent (pad));
|
trans = GST_BASE_TRANSFORM (gst_pad_get_parent (pad));
|
||||||
|
|
||||||
|
/* calculate end position of the incoming buffer */
|
||||||
|
if (GST_BUFFER_TIMESTAMP (buffer) != GST_CLOCK_TIME_NONE) {
|
||||||
|
if (GST_BUFFER_DURATION (buffer) != GST_CLOCK_TIME_NONE)
|
||||||
|
last_stop = GST_BUFFER_TIMESTAMP (buffer) + GST_BUFFER_DURATION (buffer);
|
||||||
|
else
|
||||||
|
last_stop = GST_BUFFER_TIMESTAMP (buffer);
|
||||||
|
}
|
||||||
|
|
||||||
/* protect transform method and concurrent buffer alloc */
|
/* protect transform method and concurrent buffer alloc */
|
||||||
g_mutex_lock (trans->transform_lock);
|
g_mutex_lock (trans->transform_lock);
|
||||||
ret = gst_base_transform_handle_buffer (trans, buffer, &outbuf);
|
ret = gst_base_transform_handle_buffer (trans, buffer, &outbuf);
|
||||||
|
@ -1579,6 +1588,11 @@ gst_base_transform_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
* GST_BASE_TRANSFORM_FLOW_DROPPED we will not push either. */
|
* GST_BASE_TRANSFORM_FLOW_DROPPED we will not push either. */
|
||||||
if (outbuf != NULL) {
|
if (outbuf != NULL) {
|
||||||
if ((ret == GST_FLOW_OK)) {
|
if ((ret == GST_FLOW_OK)) {
|
||||||
|
/* Remember last stop position */
|
||||||
|
if ((last_stop != GST_CLOCK_TIME_NONE) &&
|
||||||
|
(trans->segment.format == GST_FORMAT_TIME))
|
||||||
|
gst_segment_set_last_stop (&trans->segment, GST_FORMAT_TIME, last_stop);
|
||||||
|
|
||||||
/* apply DISCONT flag if the buffer is not yet marked as such */
|
/* apply DISCONT flag if the buffer is not yet marked as such */
|
||||||
if (trans->priv->discont) {
|
if (trans->priv->discont) {
|
||||||
if (!GST_BUFFER_IS_DISCONT (outbuf)) {
|
if (!GST_BUFFER_IS_DISCONT (outbuf)) {
|
||||||
|
|
Loading…
Reference in a new issue