diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2020-07-24 16:35:04 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@ocrete.ca> | 2021-09-15 15:35:43 +0000 |
commit | 75b4809ebc23814009bebc70c775ab44d85decf2 (patch) | |
tree | 8bec1072c9a2a14d037a0d989768b6c913fce977 | |
parent | a55dafe341ac7398e7c37c30d8b760228296da92 (diff) | |
download | gstreamer-plugins-base-75b4809ebc23814009bebc70c775ab44d85decf2.tar.gz |
videorate: Update the base time on segment updates
Dropping it to 0 makes videorate push buffers from timestamp 0 again.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/767>
-rw-r--r-- | gst/videorate/gstvideorate.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gst/videorate/gstvideorate.c b/gst/videorate/gstvideorate.c index c3240c955..d00f102a8 100644 --- a/gst/videorate/gstvideorate.c +++ b/gst/videorate/gstvideorate.c @@ -836,9 +836,6 @@ gst_video_rate_sink_event (GstBaseTransform * trans, GstEvent * event) gst_video_rate_swap_prev (videorate, NULL, 0); } - videorate->base_ts = 0; - videorate->out_frame_count = 0; - videorate->next_ts = GST_CLOCK_TIME_NONE; /* We just want to update the accumulated stream_time */ @@ -848,6 +845,15 @@ gst_video_rate_sink_event (GstBaseTransform * trans, GstEvent * event) segment.stop = (gint64) (segment.stop / videorate->rate); segment.time = (gint64) (segment.time / videorate->rate); + videorate->base_ts = gst_segment_position_from_running_time (&segment, + GST_FORMAT_TIME, + gst_segment_to_running_time (&videorate->segment, GST_FORMAT_TIME, + videorate->base_ts)); + videorate->next_ts = gst_segment_position_from_running_time (&segment, + GST_FORMAT_TIME, + gst_segment_to_running_time (&videorate->segment, GST_FORMAT_TIME, + videorate->next_ts)); + gst_segment_copy_into (&segment, &videorate->segment); GST_DEBUG_OBJECT (videorate, "updated segment: %" GST_SEGMENT_FORMAT, &videorate->segment); |