videorate: Don't fill up the segment with duplicate buffers if drop_only==TRUE
This commit is contained in:
parent
eda44c640e
commit
6788003912
@ -720,10 +720,11 @@ gst_video_rate_sink_event (GstBaseTransform * trans, GstEvent * event)
|
|||||||
/* fill up to the end of current segment,
|
/* fill up to the end of current segment,
|
||||||
* or only send out the stored buffer if there is no specific stop.
|
* or only send out the stored buffer if there is no specific stop.
|
||||||
* regardless, prevent going loopy in strange cases */
|
* regardless, prevent going loopy in strange cases */
|
||||||
while (res == GST_FLOW_OK && count <= MAGIC_LIMIT &&
|
while (res == GST_FLOW_OK && count <= MAGIC_LIMIT
|
||||||
((GST_CLOCK_TIME_IS_VALID (videorate->segment.stop) &&
|
&& !videorate->drop_only
|
||||||
videorate->next_ts - videorate->segment.base
|
&& ((GST_CLOCK_TIME_IS_VALID (videorate->segment.stop)
|
||||||
< videorate->segment.stop)
|
&& videorate->next_ts - videorate->segment.base <
|
||||||
|
videorate->segment.stop)
|
||||||
|| count < 1)) {
|
|| count < 1)) {
|
||||||
res = gst_video_rate_flush_prev (videorate, count > 0);
|
res = gst_video_rate_flush_prev (videorate, count > 0);
|
||||||
count++;
|
count++;
|
||||||
@ -759,14 +760,15 @@ gst_video_rate_sink_event (GstBaseTransform * trans, GstEvent * event)
|
|||||||
/* fill up to the end of current segment,
|
/* fill up to the end of current segment,
|
||||||
* or only send out the stored buffer if there is no specific stop.
|
* or only send out the stored buffer if there is no specific stop.
|
||||||
* regardless, prevent going loopy in strange cases */
|
* regardless, prevent going loopy in strange cases */
|
||||||
while (res == GST_FLOW_OK && count <= MAGIC_LIMIT &&
|
while (res == GST_FLOW_OK && count <= MAGIC_LIMIT
|
||||||
((videorate->next_ts - videorate->segment.base <
|
&& !videorate->drop_only
|
||||||
|
&& ((videorate->next_ts - videorate->segment.base <
|
||||||
videorate->segment.stop)
|
videorate->segment.stop)
|
||||||
|| count < 1)) {
|
|| count < 1)) {
|
||||||
res = gst_video_rate_flush_prev (videorate, count > 0);
|
res = gst_video_rate_flush_prev (videorate, count > 0);
|
||||||
count++;
|
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
|
/* Output at least one frame but if the buffer duration is valid, output
|
||||||
* enough frames to use the complete buffer duration */
|
* enough frames to use the complete buffer duration */
|
||||||
if (GST_BUFFER_DURATION_IS_VALID (videorate->prevbuf)) {
|
if (GST_BUFFER_DURATION_IS_VALID (videorate->prevbuf)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user