diff --git a/gst/flv/gstflvdemux.c b/gst/flv/gstflvdemux.c index 1f7000208f..37dd614b62 100644 --- a/gst/flv/gstflvdemux.c +++ b/gst/flv/gstflvdemux.c @@ -112,6 +112,8 @@ gst_flv_demux_cleanup (GstFLVDemux * demux) demux->push_tags = FALSE; demux->got_par = FALSE; + demux->no_more_pads = FALSE; + gst_segment_init (&demux->segment, GST_FORMAT_TIME); demux->w = demux->h = 0; @@ -569,7 +571,11 @@ pause: if (GST_FLOW_IS_FATAL (ret) || ret == GST_FLOW_NOT_LINKED) { if (ret == GST_FLOW_UNEXPECTED) { /* perform EOS logic */ - gst_element_no_more_pads (GST_ELEMENT_CAST (demux)); + if (!demux->no_more_pads) { + gst_element_no_more_pads (GST_ELEMENT_CAST (demux)); + demux->no_more_pads = TRUE; + } + if (demux->segment.flags & GST_SEEK_FLAG_SEGMENT) { gint64 stop; @@ -592,7 +598,11 @@ pause: } } else { /* normal playback, send EOS to all linked pads */ - gst_element_no_more_pads (GST_ELEMENT (demux)); + if (!demux->no_more_pads) { + gst_element_no_more_pads (GST_ELEMENT (demux)); + demux->no_more_pads = TRUE; + } + GST_LOG_OBJECT (demux, "Sending EOS, at end of stream"); if (!gst_flv_demux_push_src_event (demux, gst_event_new_eos ())) GST_WARNING_OBJECT (demux, "failed pushing EOS on streams"); @@ -951,7 +961,11 @@ gst_flv_demux_sink_event (GstPad * pad, GstEvent * event) GST_DEBUG_OBJECT (demux, "committing index"); gst_index_commit (demux->index, demux->index_id); } - gst_element_no_more_pads (GST_ELEMENT (demux)); + if (!demux->no_more_pads) { + gst_element_no_more_pads (GST_ELEMENT (demux)); + demux->no_more_pads = TRUE; + } + if (!gst_flv_demux_push_src_event (demux, event)) GST_WARNING_OBJECT (demux, "failed pushing EOS on streams"); ret = TRUE; diff --git a/gst/flv/gstflvdemux.h b/gst/flv/gstflvdemux.h index 72c0bcd4ec..806ab1365d 100644 --- a/gst/flv/gstflvdemux.h +++ b/gst/flv/gstflvdemux.h @@ -114,6 +114,8 @@ struct _GstFLVDemux gboolean push_tags; gboolean strict; gboolean flushing; + + gboolean no_more_pads; }; struct _GstFLVDemuxClass diff --git a/gst/flv/gstflvparse.c b/gst/flv/gstflvparse.c index 2d768eee60..21772daf68 100644 --- a/gst/flv/gstflvparse.c +++ b/gst/flv/gstflvparse.c @@ -655,6 +655,7 @@ gst_flv_parse_tag_audio (GstFLVDemux * demux, GstBuffer * buffer) if (demux->audio_pad && demux->video_pad) { GST_DEBUG_OBJECT (demux, "emitting no more pads"); gst_element_no_more_pads (GST_ELEMENT (demux)); + demux->no_more_pads = TRUE; } } @@ -969,6 +970,7 @@ gst_flv_parse_tag_video (GstFLVDemux * demux, GstBuffer * buffer) if (demux->audio_pad && demux->video_pad) { GST_DEBUG_OBJECT (demux, "emitting no more pads"); gst_element_no_more_pads (GST_ELEMENT (demux)); + demux->no_more_pads = TRUE; } }