tests/examples/seek/seek.c: Don't crash when having no visualisations.

Original commit message from CVS:
* tests/examples/seek/seek.c:
Don't crash when having no visualisations.
This commit is contained in:
Stefan Kost 2008-08-21 11:20:36 +00:00
parent 7cce52603e
commit ca5d4c1fcb
2 changed files with 15 additions and 7 deletions

View file

@ -1,3 +1,8 @@
2008-08-21 Stefan Kost <ensonic@users.sf.net>
* tests/examples/seek/seek.c:
Don't crash when having no visualisations.
2008-08-16 David Schleef <ds@schleef.org>
* gst/typefind/gsttypefindfunctions.c: DV typefinding. Remove

View file

@ -1846,14 +1846,17 @@ vis_combo_cb (GtkComboBox * combo, GstPipeline * pipeline)
/* get the selected index and get the factory for this index */
index = gtk_combo_box_get_active (GTK_COMBO_BOX (vis_combo));
entry = &g_array_index (vis_entries, VisEntry, index);
/* create an instance of the element from the factory */
element = gst_element_factory_create (entry->factory, NULL);
if (!element)
return;
if (vis_entries->len > 0) {
entry = &g_array_index (vis_entries, VisEntry, index);
/* set vis plugin for playbin2 */
g_object_set (pipeline, "vis-plugin", element, NULL);
/* create an instance of the element from the factory */
element = gst_element_factory_create (entry->factory, NULL);
if (!element)
return;
/* set vis plugin for playbin2 */
g_object_set (pipeline, "vis-plugin", element, NULL);
}
}
static void