- if (push_eos) {
- /* send EOS, and prevent hanging if no streams yet */
- GST_LOG_OBJECT (demux, "Sending EOS, at end of stream");
- if (!gst_matroska_demux_send_event (demux, gst_event_new_eos ()) &&
- (ret == GST_FLOW_UNEXPECTED)) {
- GST_ELEMENT_ERROR (demux, STREAM, DEMUX,
- (NULL), ("got eos but no streams (yet)"));
- }
+ } else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_UNEXPECTED) {
+ /* for fatal errors we post an error message */
+ GST_ELEMENT_ERROR (demux, STREAM, FAILED, (NULL),
+ ("stream stopped, reason %s", reason));
+ push_eos = TRUE;
+ }
+ if (push_eos) {
+ /* send EOS, and prevent hanging if no streams yet */
+ GST_LOG_OBJECT (demux, "Sending EOS, at end of stream");
+ if (!gst_matroska_demux_send_event (demux, gst_event_new_eos ()) &&
+ (ret == GST_FLOW_UNEXPECTED)) {
+ GST_ELEMENT_ERROR (demux, STREAM, DEMUX,
+ (NULL), ("got eos but no streams (yet)"));