From dc564727779c25eb81d3c81f32f0c4995cb92662 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Thu, 9 Feb 2017 01:12:56 +1100 Subject: [PATCH] adaptivedemux: Convert premature EOS on non-exposed pads to ERROR If we need to send EOS on a pad that hasn't prerolled, generate an error on the bus instead, otherwise the app will have no idea. Fixes the HLS testFragmentNotFound test, which is waiting for either EOS or an error. --- gst-libs/gst/adaptivedemux/gstadaptivedemux.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c index a63be65f01..4d8c2b071f 100644 --- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c +++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c @@ -3627,7 +3627,13 @@ gst_adaptive_demux_stream_download_loop (GstAdaptiveDemuxStream * stream) end_of_manifest: if (G_UNLIKELY (ret == GST_FLOW_EOS)) { - gst_adaptive_demux_stream_push_event (stream, gst_event_new_eos ()); + if (GST_OBJECT_PARENT (stream->pad) != NULL) { + GST_DEBUG_OBJECT (stream->src, "Pushing EOS on pad"); + gst_adaptive_demux_stream_push_event (stream, gst_event_new_eos ()); + } else { + GST_ERROR_OBJECT (demux, "Can't push EOS on non-exposed pad"); + goto download_error; + } } end: