examples: don't put things with side effects inside g_assert()

They will be defined away to NOOPs otherwise in release builds.
This commit is contained in:
Tim-Philipp Müller 2012-08-08 09:53:26 +01:00
parent 70393ddfb3
commit c354714544

View file

@ -123,8 +123,9 @@ main (int argc, char *argv[])
/* step two frames, flush so that new preroll is queued */ /* step two frames, flush so that new preroll is queued */
g_message ("stepping three frames"); g_message ("stepping three frames");
g_assert (gst_element_send_event (bin, if (!gst_element_send_event (bin,
gst_event_new_step (GST_FORMAT_BUFFERS, 2, 1.0, TRUE, FALSE))); gst_event_new_step (GST_FORMAT_BUFFERS, 2, 1.0, TRUE, FALSE)))
g_warning ("Filed to send STEP event!");
/* blocks and returns when we received the step done message */ /* blocks and returns when we received the step done message */
event_loop (bin); event_loop (bin);
@ -138,9 +139,10 @@ main (int argc, char *argv[])
/* step 3 frames, flush so that new preroll is queued */ /* step 3 frames, flush so that new preroll is queued */
g_message ("stepping 120 milliseconds "); g_message ("stepping 120 milliseconds ");
g_assert (gst_element_send_event (bin, if (!gst_element_send_event (bin,
gst_event_new_step (GST_FORMAT_TIME, 120 * GST_MSECOND, 1.0, TRUE, gst_event_new_step (GST_FORMAT_TIME, 120 * GST_MSECOND, 1.0, TRUE,
FALSE))); FALSE)))
g_warning ("Filed to send STEP event!");
/* blocks and returns when we received the step done message */ /* blocks and returns when we received the step done message */
event_loop (bin); event_loop (bin);