diff --git a/ext/timidity/gsttimidity.c b/ext/timidity/gsttimidity.c index c0fa519e52..997b0b20b4 100644 --- a/ext/timidity/gsttimidity.c +++ b/ext/timidity/gsttimidity.c @@ -714,7 +714,9 @@ gst_timidity_loop (GstPad * sinkpad) gst_buffer_set_caps (out, timidity->out_caps); ret = gst_pad_push (timidity->srcpad, out); - if (GST_FLOW_IS_FATAL (ret) || ret == GST_FLOW_NOT_LINKED) + if (ret == GST_FLOW_UNEXPECTED) + goto eos; + else if (ret < GST_FLOW_UNEXPECTED || ret == GST_FLOW_NOT_LINKED) goto error; return; @@ -725,6 +727,11 @@ paused: gst_pad_pause_task (timidity->sinkpad); return; } +eos: + { + gst_pad_push_event (timidity->srcpad, gst_event_new_eos ()); + goto paused; + } error: { GST_ELEMENT_ERROR (timidity, STREAM, FAILED,