summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2021-06-16 15:06:57 -0400
committerOlivier CrĂȘte <olivier.crete@ocrete.ca>2021-09-15 15:35:43 +0000
commit24fd80344dbc059b72e13d813ca82f414a9d6cce (patch)
tree492d5af2879df2cc6e7837aec328bc18ca17a981
parent6f7922b4dbba5ed780e7b0988669a81848a9e333 (diff)
downloadgstreamer-plugins-base-24fd80344dbc059b72e13d813ca82f414a9d6cce.tar.gz
videorate: Drop incoming buffers that are outside of the segment
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/767>
-rw-r--r--gst/videorate/gstvideorate.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gst/videorate/gstvideorate.c b/gst/videorate/gstvideorate.c
index e12fe391c..3c4fe0b41 100644
--- a/gst/videorate/gstvideorate.c
+++ b/gst/videorate/gstvideorate.c
@@ -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