diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2016-04-03 11:40:50 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2016-04-03 11:40:50 +0300 |
commit | 6788003912f5e261530e854e64ebbfe2f9591207 (patch) | |
tree | 1ad405f0105ad9b8d2ace3b6551383f23eac7b7c /gst | |
parent | eda44c640e3257fb36a9ed2e48a4b2ad0411f6ec (diff) |
videorate: Don't fill up the segment with duplicate buffers if drop_only==TRUE
Diffstat (limited to 'gst')
-rw-r--r-- | gst/videorate/gstvideorate.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gst/videorate/gstvideorate.c b/gst/videorate/gstvideorate.c index c8024cd43..633c19fd1 100644 --- a/gst/videorate/gstvideorate.c +++ b/gst/videorate/gstvideorate.c @@ -720,10 +720,11 @@ gst_video_rate_sink_event (GstBaseTransform * trans, GstEvent * event) /* fill up to the end of current segment, * or only send out the stored buffer if there is no specific stop. * regardless, prevent going loopy in strange cases */ - while (res == GST_FLOW_OK && count <= MAGIC_LIMIT && - ((GST_CLOCK_TIME_IS_VALID (videorate->segment.stop) && - videorate->next_ts - videorate->segment.base - < videorate->segment.stop) + while (res == GST_FLOW_OK && count <= MAGIC_LIMIT + && !videorate->drop_only + && ((GST_CLOCK_TIME_IS_VALID (videorate->segment.stop) + && videorate->next_ts - videorate->segment.base < + videorate->segment.stop) || count < 1)) { res = gst_video_rate_flush_prev (videorate, count > 0); count++; @@ -759,14 +760,15 @@ gst_video_rate_sink_event (GstBaseTransform * trans, GstEvent * event) /* fill up to the end of current segment, * or only send out the stored buffer if there is no specific stop. * regardless, prevent going loopy in strange cases */ - while (res == GST_FLOW_OK && count <= MAGIC_LIMIT && - ((videorate->next_ts - videorate->segment.base < + while (res == GST_FLOW_OK && count <= MAGIC_LIMIT + && !videorate->drop_only + && ((videorate->next_ts - videorate->segment.base < videorate->segment.stop) || count < 1)) { res = gst_video_rate_flush_prev (videorate, count > 0); count++; } - } else if (videorate->prevbuf) { + } else if (!videorate->drop_only && videorate->prevbuf) { /* Output at least one frame but if the buffer duration is valid, output * enough frames to use the complete buffer duration */ if (GST_BUFFER_DURATION_IS_VALID (videorate->prevbuf)) { |