gstreamer/gst
Xavier Claessens fb835c100a splitmuxsink: Fix occasional deadlock when ending file with subtitle
Deadlock occurs when splitting files if one stream received no buffer during
the first GOP of the next file. That can happen in that scenario for example:
 1) The first GOP of video is collected, it has a duration of 10s.
    max_in_running_time is set to 10s.
 2) Other streams catchup and we receive the first subtitle buffer at ts=0 and
    has a duration of 1min.
 3) We receive the 2nd subtitle buffer with a ts=1min. in_running_time is set to
    1min. That buffer is blocked in handle_mq_input() because
    max_in_running_time is still 10s.
 4) Since all in_running_time are now > 10s, max_out_running_time is now set to
    10s. That first GOP gets recorded into the file. The muxer pop buffers out
    of the mq, when it tries to pop a 2nd subtitle buffer it blocks because the
    GstDataQueue is empty.
 5) A 2nd GOP of video is collected and has a duration of 10s as well.
    max_in_running_time is now 20s. Since subtitle's in_running_time is already
    1min, that GOP is already complete.
 6) But let's say we overran the max file size, we thus set state to
    SPLITMUX_STATE_ENDING_FILE now. As soon as a buffer with ts > 10s (end of
    previous GOP) arrives in handle_mq_output(), EOS event is sent downstream
    instead. But since the subtitle queue is empty, that's never going to
    happen. Pipeline is now deadlocked.

To fix this situation we have to:
 - Send a dummy event through the queue to wakeup output thread.
 - Update out_running_time to at least max_out_running_time so it sends EOS.
 - Respect time order, so we set out_running_tim=max_in_running_time because
   that's bigger than previous buffer and smaller than next.

https://bugzilla.gnome.org/show_bug.cgi?id=763711
2016-04-01 00:48:05 +11:00
..
alpha good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
apetag good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
audiofx good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
audioparsers good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
auparse good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
autodetect good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
avi good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
cutter good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
debugutils good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
deinterlace deinterlace: Added "auto" fields mode 2016-03-24 14:34:11 +02:00
dtmf good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
effectv good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
equalizer equalizer: The child-proxy API is GObject based in 1.x 2016-01-05 18:59:25 +02:00
flv flvdemux: don't emit pad-added until caps are ready 2016-03-24 14:33:33 +02:00
flx gst Factor out endian-order RGB formats 2016-03-10 10:00:58 +00:00
goom good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
goom2k1 good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
icydemux good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
id3demux good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
imagefreeze good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
interleave deinterleave: Return the current caps on the srcpads on caps queries 2016-03-24 14:47:40 +02:00
isomp4 qtdemux: Fix qtdemux memory leak in src_convert function 2016-03-24 14:36:26 +02:00
law good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
level good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
matroska good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
monoscope good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
multifile splitmuxsink: Fix occasional deadlock when ending file with subtitle 2016-04-01 00:48:05 +11:00
multipart good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
replaygain good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
rtp rtpjpegpay: Allow different quantization tables for components 2 and 3 2016-03-25 12:52:56 +02:00
rtpmanager rtpsession: Add new signal 'on-app-rtcp' 2016-03-30 15:42:01 +03:00
rtsp good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
shapewipe good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
smpte good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
spectrum win32: remove outdated build cruft 2016-02-21 09:47:43 +00:00
udp good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
videobox good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
videocrop good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
videofilter good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
videomixer good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
wavenc good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
wavparse good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
y4m good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
Makefile.am build: build plugins and examples in parallel where possible 2010-03-29 11:00:57 +01:00