mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-11 19:06:33 +00:00
deinterlace: Avoid infinite loop draining frames
When the pipeline is flushed just as we're draining history, don't loop infinitely, just discard the history and abort.
This commit is contained in:
parent
addbc3c4ca
commit
9941d3f0a2
1 changed files with 10 additions and 4 deletions
|
@ -593,6 +593,16 @@ gst_deinterlace_reset_history (GstDeinterlace * self, gboolean drop_all)
|
||||||
{
|
{
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
|
if (!drop_all) {
|
||||||
|
GST_DEBUG_OBJECT (self, "Flushing history (count %d)", self->history_count);
|
||||||
|
while (self->history_count > 0) {
|
||||||
|
if (gst_deinterlace_output_frame (self, TRUE) != GST_FLOW_OK) {
|
||||||
|
/* Encountered error, or flushing -> skip and drop all remaining */
|
||||||
|
drop_all = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (drop_all) {
|
if (drop_all) {
|
||||||
GST_DEBUG_OBJECT (self, "Resetting history (count %d)",
|
GST_DEBUG_OBJECT (self, "Resetting history (count %d)",
|
||||||
self->history_count);
|
self->history_count);
|
||||||
|
@ -603,10 +613,6 @@ gst_deinterlace_reset_history (GstDeinterlace * self, gboolean drop_all)
|
||||||
self->field_history[i].buf = NULL;
|
self->field_history[i].buf = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
GST_DEBUG_OBJECT (self, "Flushing history (count %d)", self->history_count);
|
|
||||||
while (self->history_count > 0)
|
|
||||||
gst_deinterlace_output_frame (self, TRUE);
|
|
||||||
}
|
}
|
||||||
memset (self->field_history, 0,
|
memset (self->field_history, 0,
|
||||||
GST_DEINTERLACE_MAX_FIELD_HISTORY * sizeof (GstDeinterlaceField));
|
GST_DEINTERLACE_MAX_FIELD_HISTORY * sizeof (GstDeinterlaceField));
|
||||||
|
|
Loading…
Reference in a new issue