wavparse: Don't use GST_FLOW_IS_FATAL()
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Fri, 27 Aug 2010 15:47:22 +0000 (17:47 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Sat, 4 Sep 2010 12:52:10 +0000 (14:52 +0200)
gst/wavparse/gstwavparse.c

index 4f98b7e..ff01168 100644 (file)
@@ -2038,41 +2038,39 @@ pause:
     wav->segment_running = FALSE;
     gst_pad_pause_task (pad);
 
-    if (GST_FLOW_IS_FATAL (ret) || ret == GST_FLOW_NOT_LINKED) {
-      if (ret == GST_FLOW_UNEXPECTED) {
-        /* add pad before we perform EOS */
-        if (G_UNLIKELY (wav->first)) {
-          wav->first = FALSE;
-          gst_wavparse_add_src_pad (wav, NULL);
-        }
+    if (ret == GST_FLOW_UNEXPECTED) {
+      /* add pad before we perform EOS */
+      if (G_UNLIKELY (wav->first)) {
+        wav->first = FALSE;
+        gst_wavparse_add_src_pad (wav, NULL);
+      }
 
-        if (wav->state == GST_WAVPARSE_START)
-          GST_ELEMENT_ERROR (wav, STREAM, WRONG_TYPE,
-              ("No valid input found before end of stream"), (NULL));
+      if (wav->state == GST_WAVPARSE_START)
+        GST_ELEMENT_ERROR (wav, STREAM, WRONG_TYPE,
+            ("No valid input found before end of stream"), (NULL));
 
-        /* perform EOS logic */
-        if (wav->segment.flags & GST_SEEK_FLAG_SEGMENT) {
-          GstClockTime stop;
+      /* perform EOS logic */
+      if (wav->segment.flags & GST_SEEK_FLAG_SEGMENT) {
+        GstClockTime stop;
 
-          if ((stop = wav->segment.stop) == -1)
-            stop = wav->segment.duration;
+        if ((stop = wav->segment.stop) == -1)
+          stop = wav->segment.duration;
 
-          gst_element_post_message (GST_ELEMENT_CAST (wav),
-              gst_message_new_segment_done (GST_OBJECT_CAST (wav),
-                  wav->segment.format, stop));
-        } else {
-          if (wav->srcpad != NULL)
-            gst_pad_push_event (wav->srcpad, gst_event_new_eos ());
-        }
+        gst_element_post_message (GST_ELEMENT_CAST (wav),
+            gst_message_new_segment_done (GST_OBJECT_CAST (wav),
+                wav->segment.format, stop));
       } else {
-        /* for fatal errors we post an error message, post the error
-         * first so the app knows about the error first. */
-        GST_ELEMENT_ERROR (wav, STREAM, FAILED,
-            (_("Internal data flow error.")),
-            ("streaming task paused, reason %s (%d)", reason, ret));
         if (wav->srcpad != NULL)
           gst_pad_push_event (wav->srcpad, gst_event_new_eos ());
       }
+    } else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_UNEXPECTED) {
+      /* for fatal errors we post an error message, post the error
+       * first so the app knows about the error first. */
+      GST_ELEMENT_ERROR (wav, STREAM, FAILED,
+          (_("Internal data flow error.")),
+          ("streaming task paused, reason %s (%d)", reason, ret));
+      if (wav->srcpad != NULL)
+        gst_pad_push_event (wav->srcpad, gst_event_new_eos ());
     }
     return;
   }