From 45084bf579efc8aa2e086df321d27e3e18eb3356 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 12 Jun 2009 16:31:00 +0200 Subject: [PATCH] adder: send flush-stop earlier When no flush-stop has been sent by upstream, we have to send one ourselves to continue playback. Do this as soon as the collect function is called instead of after we possibly pushed segment events (that got then flushed out) --- gst/adder/gstadder.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gst/adder/gstadder.c b/gst/adder/gstadder.c index 04f58707e7..b367ebd072 100644 --- a/gst/adder/gstadder.c +++ b/gst/adder/gstadder.c @@ -906,6 +906,11 @@ gst_adder_collected (GstCollectPads * pads, gpointer user_data) if (G_UNLIKELY (adder->func == NULL)) goto not_negotiated; + if (adder->flush_stop_pending) { + gst_pad_push_event (adder->srcpad, gst_event_new_flush_stop ()); + adder->flush_stop_pending = FALSE; + } + /* get available bytes for reading, this can be 0 which could mean empty * buffers or EOS, which we will catch when we loop over the pads. */ outsize = gst_collect_pads_available (pads); @@ -1016,10 +1021,6 @@ gst_adder_collected (GstCollectPads * pads, gpointer user_data) adder->timestamp, adder->segment_position); } } - if (adder->flush_stop_pending) { - gst_pad_push_event (adder->srcpad, gst_event_new_flush_stop ()); - adder->flush_stop_pending = FALSE; - } /* set timestamps on the output buffer */ GST_BUFFER_TIMESTAMP (outbuf) = adder->timestamp;