mxfdemux: Post an error message if we got EOS before having any source pads

Otherwise, sending an EOS event has no effect and the application waits
forever for something to happen.
This commit is contained in:
Sebastian Dröge 2016-11-26 12:28:57 +02:00
parent 55043aff12
commit 88e060743a

View file

@ -3068,7 +3068,11 @@ pause:
if (flow == GST_FLOW_EOS) {
/* perform EOS logic */
if (demux->segment.flags & GST_SEEK_FLAG_SEGMENT) {
if (demux->src->len == 0) {
GST_ELEMENT_ERROR (demux, STREAM, WRONG_TYPE,
("This stream contains no data."),
("got eos and didn't find any streams"));
} else if (demux->segment.flags & GST_SEEK_FLAG_SEGMENT) {
gint64 stop;
GstMessage *m;
GstEvent *e;
@ -4084,6 +4088,12 @@ gst_mxf_demux_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
GstMXFDemuxPad *p = NULL;
guint i;
if (demux->src->len == 0) {
GST_ELEMENT_ERROR (demux, STREAM, WRONG_TYPE,
("This stream contains no data."),
("got eos and didn't find any streams"));
}
for (i = 0; i < demux->essence_tracks->len; i++) {
GstMXFDemuxEssenceTrack *t =
&g_array_index (demux->essence_tracks, GstMXFDemuxEssenceTrack, i);