gst/base/basesink: Remove dead assignment.
authorEdward Hervey <bilboed@bilboed.com>
Thu, 8 Oct 2009 06:53:54 +0000 (08:53 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Thu, 8 Oct 2009 06:53:54 +0000 (08:53 +0200)
The code was previously:
* checking if ret was != OK
* .. but if it was FLOW_STEP, swith it to OK
* .. and then not using ret

Instead we just make it more compact by checking if it's OK or STEP.

libs/gst/base/gstbasesink.c

index 4d35948..12841df 100644 (file)
@@ -2086,12 +2086,8 @@ gst_base_sink_do_preroll (GstBaseSink * sink, GstMiniObject * obj)
     if (G_LIKELY (sink->need_preroll)) {
       /* block until the state changes, or we get a flush, or something */
       ret = gst_base_sink_wait_preroll (sink);
-      if (ret != GST_FLOW_OK) {
-        if (ret == GST_FLOW_STEP)
-          ret = GST_FLOW_OK;
-        else
-          goto preroll_failed;
-      }
+      if ((ret != GST_FLOW_OK) && (ret != GST_FLOW_STEP))
+        goto preroll_failed;
     }
   }
   return GST_FLOW_OK;
@@ -2139,12 +2135,8 @@ gst_base_sink_wait_eos (GstBaseSink * sink, GstClockTime time,
     /* first wait for the playing state before we can continue */
     if (G_UNLIKELY (sink->need_preroll)) {
       ret = gst_base_sink_wait_preroll (sink);
-      if (ret != GST_FLOW_OK) {
-        if (ret == GST_FLOW_STEP)
-          ret = GST_FLOW_OK;
-        else
-          goto flushing;
-      }
+      if ((ret != GST_FLOW_OK) && (ret != GST_FLOW_STEP))
+        goto flushing;
     }
 
     /* preroll done, we can sync since we are in PLAYING now. */