random cleanups and paranoia checks

Original commit message from CVS:
random cleanups and paranoia checks
This commit is contained in:
Thomas Vander Stichele 2002-11-29 13:59:30 +00:00
parent f6f841cbb8
commit 35387bca47
9 changed files with 28 additions and 23 deletions

View file

@ -4,7 +4,7 @@ else
GNOME=
endif
EXAMPLES = dynamic $(GNOME) helloworld helloworld2 queue xml-mp3
EXAMPLES = dynamic $(GNOME) helloworld helloworld2 queue threads xml-mp3
noinst_PROGRAMS = $(EXAMPLES)
LDADD = $(GST_LIBS)
@ -23,5 +23,5 @@ EXTRA_DIST = extract.pl
# also, it's a bit irritating that right now a change in any xml file
# triggers a rebuild of all examples
#%.c:
dynamic.c gnome.c helloworld.c helloworld2.c queue.c xml-mp3.c: $(top_srcdir)/docs/manual/*.xml
dynamic.c gnome.c helloworld.c helloworld2.c queue.c threads.c xml-mp3.c: $(top_srcdir)/docs/manual/*.xml
$(srcdir)/extract.pl $@ $(top_srcdir)/docs/manual/*.xml

View file

@ -296,7 +296,10 @@ cothread_free (cothread_state *cothread)
cothread->cothreadnum);
/* we simply flag the cothread for destruction here */
cothread->flags |= COTHREAD_DESTROYED;
if (cothread)
cothread->flags |= COTHREAD_DESTROYED;
else
g_warning ("somebody set up us the bomb");
}
static void

View file

@ -4,7 +4,7 @@ else
GNOME=
endif
EXAMPLES = dynamic $(GNOME) helloworld helloworld2 queue xml-mp3
EXAMPLES = dynamic $(GNOME) helloworld helloworld2 queue threads xml-mp3
noinst_PROGRAMS = $(EXAMPLES)
LDADD = $(GST_LIBS)
@ -23,5 +23,5 @@ EXTRA_DIST = extract.pl
# also, it's a bit irritating that right now a change in any xml file
# triggers a rebuild of all examples
#%.c:
dynamic.c gnome.c helloworld.c helloworld2.c queue.c xml-mp3.c: $(top_srcdir)/docs/manual/*.xml
dynamic.c gnome.c helloworld.c helloworld2.c queue.c threads.c xml-mp3.c: $(top_srcdir)/docs/manual/*.xml
$(srcdir)/extract.pl $@ $(top_srcdir)/docs/manual/*.xml

View file

@ -24,7 +24,7 @@ main (gint argc, gchar *argv[])
GstElement *bin;
GstElement *fakesink;
fprintf (stderr, "+");
g_print ("+");
bin = gst_bin_new ("bin");
@ -41,11 +41,11 @@ main (gint argc, gchar *argv[])
gst_element_set_state (pipeline, GST_STATE_NULL);
fprintf (stderr, "-");
g_print ("-");
gst_bin_remove (GST_BIN (pipeline), GST_ELEMENT (bin));
}
fprintf (stderr, "\n");
g_print ("\n");
g_mem_chunk_info ();
return 0;

View file

@ -8,7 +8,7 @@ gboolean running = FALSE;
gboolean can_quit = FALSE;
static void
construct_pipeline (GstElement *pipeline, gint identities)
construct_pipeline (GstElement *pipeline, gint identities)
{
GstElement *src, *sink, *identity;
GstElement *from;
@ -31,7 +31,7 @@ construct_pipeline (GstElement *pipeline, gint identities)
}
gst_element_connect (identity, sink);
g_object_set (G_OBJECT (src), "num_buffers", 10, "sizetype", 3, NULL);
g_object_set (G_OBJECT (src), "num_buffers", 2, "sizetype", 3, NULL);
}
void
@ -56,7 +56,7 @@ state_changed (GstElement *el, gint arg1, gint arg2, gpointer user_data)
int
main (gint argc, gchar *argv[])
{
int runs = 130;
int runs = 290;
int i;
gulong id;
GstElement *thread;
@ -69,12 +69,13 @@ main (gint argc, gchar *argv[])
g_assert (thread);
/* connect state change signal */
id = g_signal_connect (G_OBJECT (thread), "state_change",
id = g_signal_connect (G_OBJECT (thread), "state_change",
G_CALLBACK (state_changed), NULL);
construct_pipeline (thread, i / 10 + 1);
g_print ("Setting thread to play with %d identities\n", i / 10 + 1);
gst_element_set_state (thread, GST_STATE_PLAYING);
if (gst_element_set_state (thread, GST_STATE_PLAYING) == GST_STATE_FAILURE)
g_error ("Failed setting thread to play\n");
g_print ("Going into the main GStreamer loop\n");
can_quit = TRUE; /* we don't want gst_main_quit called before gst_main */

View file

@ -48,7 +48,7 @@ thread (void)
int i;
GstElement *pipeline;
for (i = 0; i < runs; ++i)
for (i = 50; i < runs; ++i)
{
pipeline = gst_pipeline_new ("main_pipeline");
g_assert (pipeline);

View file

@ -24,7 +24,7 @@ main (gint argc, gchar *argv[])
GstElement *bin;
GstElement *fakesink;
fprintf (stderr, "+");
g_print ("+");
bin = gst_bin_new ("bin");
@ -41,11 +41,11 @@ main (gint argc, gchar *argv[])
gst_element_set_state (pipeline, GST_STATE_NULL);
fprintf (stderr, "-");
g_print ("-");
gst_bin_remove (GST_BIN (pipeline), GST_ELEMENT (bin));
}
fprintf (stderr, "\n");
g_print ("\n");
g_mem_chunk_info ();
return 0;

View file

@ -8,7 +8,7 @@ gboolean running = FALSE;
gboolean can_quit = FALSE;
static void
construct_pipeline (GstElement *pipeline, gint identities)
construct_pipeline (GstElement *pipeline, gint identities)
{
GstElement *src, *sink, *identity;
GstElement *from;
@ -31,7 +31,7 @@ construct_pipeline (GstElement *pipeline, gint identities)
}
gst_element_connect (identity, sink);
g_object_set (G_OBJECT (src), "num_buffers", 10, "sizetype", 3, NULL);
g_object_set (G_OBJECT (src), "num_buffers", 2, "sizetype", 3, NULL);
}
void
@ -56,7 +56,7 @@ state_changed (GstElement *el, gint arg1, gint arg2, gpointer user_data)
int
main (gint argc, gchar *argv[])
{
int runs = 130;
int runs = 290;
int i;
gulong id;
GstElement *thread;
@ -69,12 +69,13 @@ main (gint argc, gchar *argv[])
g_assert (thread);
/* connect state change signal */
id = g_signal_connect (G_OBJECT (thread), "state_change",
id = g_signal_connect (G_OBJECT (thread), "state_change",
G_CALLBACK (state_changed), NULL);
construct_pipeline (thread, i / 10 + 1);
g_print ("Setting thread to play with %d identities\n", i / 10 + 1);
gst_element_set_state (thread, GST_STATE_PLAYING);
if (gst_element_set_state (thread, GST_STATE_PLAYING) == GST_STATE_FAILURE)
g_error ("Failed setting thread to play\n");
g_print ("Going into the main GStreamer loop\n");
can_quit = TRUE; /* we don't want gst_main_quit called before gst_main */

View file

@ -48,7 +48,7 @@ thread (void)
int i;
GstElement *pipeline;
for (i = 0; i < runs; ++i)
for (i = 50; i < runs; ++i)
{
pipeline = gst_pipeline_new ("main_pipeline");
g_assert (pipeline);