From ca36cd465d776b57e42bd6fb9ae76f8d7f825fb7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 17 Apr 2008 20:58:00 +0000 Subject: [PATCH] ext/amrnb/amrnbparse.c: We should also stop the streaming task when we get a NOT_LINKED flow return, which is not cov... Original commit message from CVS: * ext/amrnb/amrnbparse.c: (gst_amrnbparse_loop): We should also stop the streaming task when we get a NOT_LINKED flow return, which is not covered by FLOW_IS_FATAL. --- ChangeLog | 6 ++++++ ext/amrnb/amrnbparse.c | 20 +++++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 53701e2..fc838f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-04-17 Tim-Philipp Müller + + * ext/amrnb/amrnbparse.c: (gst_amrnbparse_loop): + We should also stop the streaming task when we get a NOT_LINKED + flow return, which is not covered by FLOW_IS_FATAL. + 2008-04-11 Julien Moutte * gst/mpegaudioparse/gstxingmux.c: (generate_xing_header): Fix diff --git a/ext/amrnb/amrnbparse.c b/ext/amrnb/amrnbparse.c index 32d67cb..c91ebed 100644 --- a/ext/amrnb/amrnbparse.c +++ b/ext/amrnb/amrnbparse.c @@ -488,12 +488,22 @@ gst_amrnbparse_loop (GstPad * pad) ret = gst_pad_push (amrnbparse->srcpad, buffer); - if (ret != GST_FLOW_OK) { + if (G_UNLIKELY (ret != GST_FLOW_OK)) { GST_DEBUG_OBJECT (amrnbparse, "Flow: %s", gst_flow_get_name (ret)); - if (GST_FLOW_IS_FATAL (ret)) { - GST_ELEMENT_ERROR (amrnbparse, STREAM, FAILED, (NULL), /* _("Internal data flow error.")), */ - ("streaming task paused, reason: %s", gst_flow_get_name (ret))); - gst_pad_push_event (pad, gst_event_new_eos ()); + if (GST_FLOW_IS_FATAL (ret) || ret == GST_FLOW_NOT_LINKED) { + if (ret == GST_FLOW_UNEXPECTED) { + /* we don't do seeking yet, so no segment flag to check here either */ + if (0) { + /* post segment_done message here one day when seeking works */ + } else { + GST_LOG_OBJECT (amrnbparse, "Sending EOS at end of segment"); + gst_pad_push_event (amrnbparse->srcpad, gst_event_new_eos ()); + } + } else { + GST_ELEMENT_ERROR (amrnbparse, STREAM, FAILED, (NULL), + ("streaming stopped, reason: %s", gst_flow_get_name (ret))); + gst_pad_push_event (amrnbparse->srcpad, gst_event_new_eos ()); + } } goto need_pause; } -- 2.7.4