mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
examples: don't put code with side-effects into g_assert()
Otherwise things won't work too well when compiling with -DG_DISABLE_ASSERT (as we do for pre-releases and releases).
This commit is contained in:
parent
c2bc6327cd
commit
9e050481c2
1 changed files with 6 additions and 3 deletions
|
@ -102,9 +102,12 @@ main (int argc, char *argv[])
|
|||
|
||||
gst_bin_add_many (GST_BIN (pipeline), audiotestsrc, audioconvert, level,
|
||||
fakesink, NULL);
|
||||
g_assert (gst_element_link (audiotestsrc, audioconvert));
|
||||
g_assert (gst_element_link_filtered (audioconvert, level, caps));
|
||||
g_assert (gst_element_link (level, fakesink));
|
||||
if (!gst_element_link (audiotestsrc, audioconvert))
|
||||
g_error ("Failed to link audiotestsrc and audioconvert");
|
||||
if (!gst_element_link_filtered (audioconvert, level, caps))
|
||||
g_error ("Failed to link audioconvert and level");
|
||||
if (!gst_element_link (level, fakesink))
|
||||
g_error ("Failed to link level and fakesink");
|
||||
|
||||
/* make sure we'll get messages */
|
||||
g_object_set (G_OBJECT (level), "message", TRUE, NULL);
|
||||
|
|
Loading…
Reference in a new issue