mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
videorate: Drop incoming buffers that are outside of the segment
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/767>
This commit is contained in:
parent
6f7922b4db
commit
24fd80344d
1 changed files with 11 additions and 0 deletions
|
@ -1521,6 +1521,10 @@ gst_video_rate_transform_ip (GstBaseTransform * trans, GstBuffer * buffer)
|
|||
goto invalid_buffer;
|
||||
}
|
||||
|
||||
if (!gst_segment_clip (&videorate->segment, GST_FORMAT_TIME, in_ts,
|
||||
GST_CLOCK_TIME_NONE, NULL, NULL))
|
||||
goto outside_segment;
|
||||
|
||||
/* get the time of the next expected buffer timestamp, we use this when the
|
||||
* next buffer has -1 as a timestamp */
|
||||
last_ts = videorate->last_ts;
|
||||
|
@ -1787,6 +1791,13 @@ invalid_buffer:
|
|||
res = GST_BASE_TRANSFORM_FLOW_DROPPED;
|
||||
goto done;
|
||||
}
|
||||
|
||||
outside_segment:
|
||||
{
|
||||
GST_WARNING_OBJECT (videorate, "Got buffer outide segment, discarding it");
|
||||
res = GST_BASE_TRANSFORM_FLOW_DROPPED;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
Loading…
Reference in a new issue