basesink: Check if buffers are too late before calling prepare/prepare_list

https://bugzilla.gnome.org/show_bug.cgi?id=690936
This commit is contained in:
Sebastian Dröge 2013-01-01 10:23:59 +01:00
parent d0c8831f1f
commit c859a1719c

View file

@ -3259,6 +3259,24 @@ gst_base_sink_chain_unlocked (GstBaseSink * basesink, GstPad * pad,
goto out_of_segment; goto out_of_segment;
} }
if (bclass->prepare || bclass->prepare_list) {
gboolean late = FALSE;
gboolean do_sync = TRUE, stepped = FALSE, step_end, syncable = TRUE;
GstClockTime sstart, sstop, rstart, rstop;
GstStepInfo *current;
current = &priv->current_step;
syncable =
gst_base_sink_get_sync_times (basesink, obj, &sstart, &sstop, &rstart,
&rstop, &do_sync, &stepped, current, &step_end);
if (!stepped && syncable && do_sync)
late =
gst_base_sink_is_too_late (basesink, obj, rstart, rstop,
GST_CLOCK_EARLY, 0);
if (late)
goto dropped;
if (!is_list) { if (!is_list) {
if (bclass->prepare) { if (bclass->prepare) {
ret = bclass->prepare (basesink, GST_BUFFER_CAST (obj)); ret = bclass->prepare (basesink, GST_BUFFER_CAST (obj));
@ -3272,6 +3290,7 @@ gst_base_sink_chain_unlocked (GstBaseSink * basesink, GstPad * pad,
goto prepare_failed; goto prepare_failed;
} }
} }
}
again: again:
late = FALSE; late = FALSE;