basesrc: Sending eos maybe block for a small period or if pipeline is PAUSED
Submitted by Nicolas Dufresne
While fixing bug 783301 I had to make a small thread-off. So now, instead of blocking forever in unpredictable condition, this call may block for a short period of time (or as long as the pipeline is paused).
This is a side effect of having to unlock/unlock_stop the source and not flushing downstream. This is needed to handle the case where we have udpsrc in the pipeline that isn't receiving data. In that case, the queued eos event would never be handled.
A possible solution would be to queue the EOS, and run the unlock/unlock_stop sequence asynchronously. Assuming we make sure the ref-count is done properly, and that we clearly the pending EOS is fully thread safe, I believe that gst_element_call_async() could be used. Obviously, large testing will be needed again.
We should probably have a look at bug 752815 while at it, as it seems fairly similar, at least at first sight.