From b64fd034a58ad433ad489d2748a72abfc3ef0d6a Mon Sep 17 00:00:00 2001 From: Sebastian Dröge Date: Wed, 2 May 2007 17:08:09 +0000 Subject: ext/flac/gstflacdec.c: Correctly post an error on the bus if something went wrong in the loop function. This fixes a ... Original commit message from CVS: * ext/flac/gstflacdec.c: (gst_flac_dec_loop): Correctly post an error on the bus if something went wrong in the loop function. This fixes a few cases where the task was paused and nothing happened anymore. --- ChangeLog | 7 +++++++ ext/flac/gstflacdec.c | 13 +++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d6807345..558841a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-05-02 Sebastian Dröge + + * ext/flac/gstflacdec.c: (gst_flac_dec_loop): + Correctly post an error on the bus if something went wrong in the loop + function. This fixes a few cases where the task was paused and nothing + happened anymore. + 2007-05-02 Wim Taymans * gst/rtsp/test.c: (main): diff --git a/ext/flac/gstflacdec.c b/ext/flac/gstflacdec.c index 1cf238ea..4da09eff 100644 --- a/ext/flac/gstflacdec.c +++ b/ext/flac/gstflacdec.c @@ -52,6 +52,7 @@ #include #include "gstflacdec.h" +#include #include #include @@ -931,10 +932,14 @@ analyze_state: case FLAC__SEEKABLE_STREAM_DECODER_SEEKING:{ GST_DEBUG_OBJECT (flacdec, "everything ok"); - if (flacdec->last_flow != GST_FLOW_OK && - flacdec->last_flow != GST_FLOW_NOT_LINKED) { - GST_DEBUG_OBJECT (flacdec, "last_flow return was %s, pausing", - gst_flow_get_name (flacdec->last_flow)); + if (GST_FLOW_IS_FATAL (flacdec->last_flow) || + flacdec->last_flow == GST_FLOW_NOT_LINKED) { + GST_ELEMENT_ERROR (flacdec, STREAM, FAILED, + (_("Internal data stream error.")), + ("stream stopped, reason %s", + gst_flow_get_name (flacdec->last_flow))); + goto eos_and_pause; + } else if (flacdec->last_flow != GST_FLOW_OK) { goto pause; } -- cgit