/* blocked until active the sind pad or flush */
gst_input_selector_eos_wait (sel, selpad);
forward = TRUE;
+ } else {
+ /* Notify all waiting pads about going EOS now */
+ sel->eos = TRUE;
+ GST_INPUT_SELECTOR_BROADCAST (sel);
}
+
selpad->eos_sent = TRUE;
GST_DEBUG_OBJECT (pad, "received EOS");
break;
gst_input_selector_activate_sinkpad (sel, GST_PAD_CAST (selpad));
active_selpad = GST_SELECTOR_PAD_CAST (active_sinkpad);
- if (sel->eos) {
- GST_DEBUG_OBJECT (sel, "Not waiting because inputselector reach EOS.");
- GST_INPUT_SELECTOR_UNLOCK (sel);
- return FALSE;
- }
-
if (seg->format != GST_FORMAT_TIME) {
GST_DEBUG_OBJECT (selpad,
"Not waiting because we don't have a TIME segment");
GST_FORMAT_TIME, active_seg->position);
}
- if (selpad != active_selpad && !sel->flushing && !selpad->flushing &&
- (sel->blocked || cur_running_time == GST_CLOCK_TIME_NONE
+ if (selpad != active_selpad && !sel->eos && !sel->flushing
+ && !selpad->flushing && (sel->blocked
+ || cur_running_time == GST_CLOCK_TIME_NONE
|| running_time >= cur_running_time)) {
if (!sel->blocked) {
GST_DEBUG_OBJECT (selpad,
GST_INPUT_SELECTOR_LOCK (sel);
if (sel->eos) {
- GST_DEBUG_OBJECT (pad, "inputselector eos.");
GST_INPUT_SELECTOR_UNLOCK (sel);
goto eos;
}
saved_segment = selpad->segment;
selpad->sending_cached_buffers = TRUE;
- while (!sel->flushing && !selpad->flushing &&
+ while (!sel->eos && !sel->flushing && !selpad->flushing &&
(cached_buffer = g_queue_pop_head (selpad->cached_buffers))) {
GST_DEBUG_OBJECT (pad, "Cached buffers found, "
"invoking chain for cached buffer %p", cached_buffer->buffer);
active_sinkpad = gst_input_selector_activate_sinkpad (sel, pad);
}
+ if (sel->eos) {
+ GST_INPUT_SELECTOR_UNLOCK (sel);
+ goto eos;
+ }
+
/* update the segment on the srcpad */
if (GST_BUFFER_PTS_IS_VALID (buf)) {
GstClockTime start_time = GST_BUFFER_PTS (buf);