mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-26 02:00:33 +00:00
examples: avoid sprinkle running endlessly
Quit sprinkle when there are no more frequencies to remove. Also rename for readability the check for linking elements.
This commit is contained in:
parent
fe0a9ec618
commit
2145586ab6
1 changed files with 8 additions and 3 deletions
|
@ -164,7 +164,12 @@ do_sprinkle (SprinkleState * state)
|
|||
state->count++;
|
||||
} else {
|
||||
state->infos[0] = NULL;
|
||||
|
||||
/* if no more sources left, quit */
|
||||
if (!state->infos[2])
|
||||
g_main_loop_quit (loop);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -202,7 +207,7 @@ main (int argc, char *argv[])
|
|||
GstBus *bus;
|
||||
GstElement *filter, *convert, *sink;
|
||||
GstCaps *caps;
|
||||
gboolean res;
|
||||
gboolean linked;
|
||||
SprinkleState *state;
|
||||
|
||||
gst_init (&argc, &argv);
|
||||
|
@ -227,8 +232,8 @@ main (int argc, char *argv[])
|
|||
|
||||
gst_bin_add_many (GST_BIN (pipeline), adder, filter, convert, sink, NULL);
|
||||
|
||||
res = gst_element_link_many (adder, filter, convert, sink, NULL);
|
||||
g_assert (res);
|
||||
linked = gst_element_link_many (adder, filter, convert, sink, NULL);
|
||||
g_assert (linked);
|
||||
|
||||
/* setup message handling */
|
||||
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
|
||||
|
|
Loading…
Reference in a new issue