From 0753d9fee3937fdb8962c93155f1f0520893557f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 27 Aug 2010 17:52:18 +0200 Subject: [PATCH] cmmldec/enc: Don't use GST_FLOW_IS_FATAL() And as a result, don't ignore WRONG_STATE and NOT_LINKED. Both mean that it's a good idea to pass them upstream instead of pretending that everything is good. --- ext/annodex/gstcmmldec.c | 6 ++---- ext/annodex/gstcmmlenc.c | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ext/annodex/gstcmmldec.c b/ext/annodex/gstcmmldec.c index 8fd6e6e277..4da167b34b 100644 --- a/ext/annodex/gstcmmldec.c +++ b/ext/annodex/gstcmmldec.c @@ -511,7 +511,7 @@ gst_cmml_dec_parse_first_header (GstCmmlDec * dec, GstBuffer * buffer) /* if there is a processing instruction, gst_cmml_dec_parse_preamble * will be triggered. Otherwise we need to call it manually. */ - if (!GST_FLOW_IS_FATAL (dec->flow_return) && !dec->sent_root) { + if (dec->flow_return != GST_FLOW_OK && !dec->sent_root) { guchar *preamble = (guchar *) g_strndup ((gchar *) GST_BUFFER_DATA (buffer), GST_BUFFER_SIZE (buffer)); @@ -555,9 +555,7 @@ gst_cmml_dec_parse_preamble (GstCmmlDec * dec, guchar * preamble, dec->flow_return = gst_pad_push (dec->srcpad, buffer); } - if (dec->flow_return == GST_FLOW_NOT_LINKED) - dec->flow_return = GST_FLOW_OK; /* Ignore NOT_LINKED */ - if (!GST_FLOW_IS_FATAL (dec->flow_return)) { + if (dec->flow_return == GST_FLOW_OK) { GST_INFO_OBJECT (dec, "preamble parsed"); } diff --git a/ext/annodex/gstcmmlenc.c b/ext/annodex/gstcmmlenc.c index 035e08da22..3df58bb3f5 100644 --- a/ext/annodex/gstcmmlenc.c +++ b/ext/annodex/gstcmmlenc.c @@ -453,7 +453,7 @@ gst_cmml_enc_parse_tag_head (GstCmmlEnc * enc, GstCmmlTagHead * head) enc->flow_return = gst_cmml_enc_push (enc, buffer); headers = g_list_delete_link (headers, headers); - if (GST_FLOW_IS_FATAL (enc->flow_return)) + if (enc->flow_return != GST_FLOW_OK) goto push_error; } @@ -558,7 +558,7 @@ gst_cmml_enc_push_clip (GstCmmlEnc * enc, GstCmmlTagClip * clip, GST_BUFFER_TIMESTAMP (buffer) = clip->start_time; res = gst_cmml_enc_push (enc, buffer); - if (GST_FLOW_IS_FATAL (res)) + if (res != GST_FLOW_OK) goto done; if (clip->end_time != GST_CLOCK_TIME_NONE) { @@ -586,7 +586,7 @@ gst_cmml_enc_push (GstCmmlEnc * enc, GstBuffer * buffer) GstFlowReturn res; res = gst_pad_push (enc->srcpad, buffer); - if (GST_FLOW_IS_FATAL (res)) + if (res != GST_FLOW_OK) GST_WARNING_OBJECT (enc, "push returned: %s", gst_flow_get_name (res)); return res;