mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
flvdemux: Make sure to only signal no-more-pads a single time
This commit is contained in:
parent
ccddf0643d
commit
f84bc538b5
3 changed files with 21 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -114,6 +114,8 @@ struct _GstFLVDemux
|
|||
gboolean push_tags;
|
||||
gboolean strict;
|
||||
gboolean flushing;
|
||||
|
||||
gboolean no_more_pads;
|
||||
};
|
||||
|
||||
struct _GstFLVDemuxClass
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue