From a14849fea89be329e2e591c386361681242a01ee Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sat, 19 Feb 2000 10:50:26 +0000 Subject: [PATCH] Fixed the lockup by not calling any gtk functions in the main thread. Original commit message from CVS: Fixed the lockup by not calling any gtk functions in the main thread. This is not good. --- gst/elements/Makefile.am | 2 ++ gst/elements/gstqueue.c | 4 ++-- plugins/elements/Makefile.am | 2 ++ plugins/elements/gstqueue.c | 4 ++-- test/mp1parse.c | 6 ++++++ 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/gst/elements/Makefile.am b/gst/elements/Makefile.am index a455576..059659a 100644 --- a/gst/elements/Makefile.am +++ b/gst/elements/Makefile.am @@ -38,5 +38,7 @@ noinst_HEADERS = \ gstqueue.h \ gstsinesrc.h +CFLAGS += -g + libgstelements_la_LIBADD = $(GLIB_LIBS) $(GTK_LIBS) $(GHTTP_LIBS) libgstelements_la_LDFLAGS = -version-info $(STREAMER_CURRENT):$(STREAMER_REVISION):$(STREAMER_AGE) diff --git a/gst/elements/gstqueue.c b/gst/elements/gstqueue.c index c0a6501..ad8209a 100644 --- a/gst/elements/gstqueue.c +++ b/gst/elements/gstqueue.c @@ -103,7 +103,7 @@ static void gst_queue_init(GstQueue *queue) { queue->queue = NULL; queue->tail = NULL; queue->level_buffers = 0; - queue->max_buffers = 1; + queue->max_buffers = 10; queue->level_bytes = 0; queue->size_buffers = 0; queue->size_bytes = 0; @@ -200,7 +200,7 @@ void gst_queue_push(GstConnection *connection) { gst_pad_push(queue->srcpad,buf); g_list_free(front); queue->level_buffers--; -// g_print("-"); + //g_print("-"); tosignal = queue->level_buffers < queue->max_buffers; GST_UNLOCK(queue); diff --git a/plugins/elements/Makefile.am b/plugins/elements/Makefile.am index a455576..059659a 100644 --- a/plugins/elements/Makefile.am +++ b/plugins/elements/Makefile.am @@ -38,5 +38,7 @@ noinst_HEADERS = \ gstqueue.h \ gstsinesrc.h +CFLAGS += -g + libgstelements_la_LIBADD = $(GLIB_LIBS) $(GTK_LIBS) $(GHTTP_LIBS) libgstelements_la_LDFLAGS = -version-info $(STREAMER_CURRENT):$(STREAMER_REVISION):$(STREAMER_AGE) diff --git a/plugins/elements/gstqueue.c b/plugins/elements/gstqueue.c index c0a6501..ad8209a 100644 --- a/plugins/elements/gstqueue.c +++ b/plugins/elements/gstqueue.c @@ -103,7 +103,7 @@ static void gst_queue_init(GstQueue *queue) { queue->queue = NULL; queue->tail = NULL; queue->level_buffers = 0; - queue->max_buffers = 1; + queue->max_buffers = 10; queue->level_bytes = 0; queue->size_buffers = 0; queue->size_bytes = 0; @@ -200,7 +200,7 @@ void gst_queue_push(GstConnection *connection) { gst_pad_push(queue->srcpad,buf); g_list_free(front); queue->level_buffers--; -// g_print("-"); + //g_print("-"); tosignal = queue->level_buffers < queue->max_buffers; GST_UNLOCK(queue); diff --git a/test/mp1parse.c b/test/mp1parse.c index 8a485af..da0d149 100644 --- a/test/mp1parse.c +++ b/test/mp1parse.c @@ -151,9 +151,15 @@ int main(int argc,char *argv[]) { g_print("about to enter loop\n"); + while (1) { + gst_src_push(GST_SRC(src)); + } + // this does not work due to multithreading + /* g_idle_add(idle_func,src); gtk_main(); + */ } gboolean idle_func(gpointer data) { -- 2.7.4