From 4f26ec3cfd9fa34eee6858e3af385d60fbc123c9 Mon Sep 17 00:00:00 2001 From: Julien Moutte Date: Fri, 8 Feb 2008 14:34:41 +0000 Subject: [PATCH] tests/examples/seek/seek.c: Make sure bus signals are reconnected when pressing STOP and then PLAY again for a parse ... Original commit message from CVS: 2008-02-08 Julien Moutte * tests/examples/seek/seek.c: (stop_cb), (connect_bus_signals), (main): Make sure bus signals are reconnected when pressing STOP and then PLAY again for a parse launch pipeline. Fix a ref leak on the bus. * win32/common/config.h: Updated. --- ChangeLog | 8 +++++ common | 2 +- tests/examples/seek/seek.c | 63 +++++++++++++++++++++----------------- win32/common/config.h | 8 ++--- 4 files changed, 48 insertions(+), 33 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8f695e0423..158022a2fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-02-08 Julien Moutte + + * tests/examples/seek/seek.c: (stop_cb), (connect_bus_signals), + (main): Make sure bus signals are reconnected when pressing STOP + and then PLAY again for a parse launch pipeline. Fix a ref leak + on the bus. + * win32/common/config.h: Updated. + 2008-02-08 Jan Schmidt * configure.ac: diff --git a/common b/common index 8b37d7ee83..df7f73bd45 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 8b37d7ee833fab1d25b484d8574df3dae231b5f2 +Subproject commit df7f73bd454e0b0ee7870d8c85874aba9329fd2e diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index e69f4d65f6..a288c7f97b 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -1112,7 +1112,7 @@ update_scale (gpointer data) } static void do_seek (GtkWidget * widget); - +static void connect_bus_signals (GstElement * pipeline); static void set_update_scale (gboolean active); static gboolean @@ -1372,6 +1372,7 @@ stop_cb (GtkButton * button, gpointer data) pipeline = pipelines[pipeline_type].func (pipeline_spec); g_assert (pipeline); gst_element_set_state (pipeline, GST_STATE_READY); + connect_bus_signals (pipeline); } } return; @@ -1595,6 +1596,38 @@ msg_segment_done (GstBus * bus, GstMessage * message, GstPipeline * pipeline) g_print ("segment seek failed\n"); } +static void +connect_bus_signals (GstElement * pipeline) +{ + GstBus *bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); + + gst_bus_add_signal_watch_full (bus, G_PRIORITY_HIGH); + + g_signal_connect (bus, "message::state-changed", + (GCallback) msg_state_changed, pipeline); + g_signal_connect (bus, "message::segment-done", (GCallback) msg_segment_done, + pipeline); + g_signal_connect (bus, "message::async-done", (GCallback) msg_async_done, + pipeline); + + g_signal_connect (bus, "message::new-clock", (GCallback) message_received, + pipeline); + g_signal_connect (bus, "message::error", (GCallback) message_received, + pipeline); + g_signal_connect (bus, "message::warning", (GCallback) message_received, + pipeline); + g_signal_connect (bus, "message::eos", (GCallback) message_received, + pipeline); + g_signal_connect (bus, "message::tag", (GCallback) message_received, + pipeline); + g_signal_connect (bus, "message::element", (GCallback) message_received, + pipeline); + g_signal_connect (bus, "message::segment-done", (GCallback) message_received, + pipeline); + + gst_object_unref (bus); +} + static void print_usage (int argc, char **argv) { @@ -1815,34 +1848,8 @@ main (int argc, char **argv) g_signal_connect (pipeline, "deep_notify", G_CALLBACK (gst_object_default_deep_notify), NULL); } - { - GstBus *bus; - bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); - gst_bus_add_signal_watch_full (bus, G_PRIORITY_HIGH); - - g_signal_connect (bus, "message::state-changed", - (GCallback) msg_state_changed, pipeline); - g_signal_connect (bus, "message::segment-done", - (GCallback) msg_segment_done, pipeline); - g_signal_connect (bus, "message::async-done", - (GCallback) msg_async_done, pipeline); - - g_signal_connect (bus, "message::new-clock", (GCallback) message_received, - pipeline); - g_signal_connect (bus, "message::error", (GCallback) message_received, - pipeline); - g_signal_connect (bus, "message::warning", (GCallback) message_received, - pipeline); - g_signal_connect (bus, "message::eos", (GCallback) message_received, - pipeline); - g_signal_connect (bus, "message::tag", (GCallback) message_received, - pipeline); - g_signal_connect (bus, "message::element", (GCallback) message_received, - pipeline); - g_signal_connect (bus, "message::segment-done", - (GCallback) message_received, pipeline); - } + connect_bus_signals (pipeline); gtk_main (); g_print ("NULL pipeline\n"); diff --git a/win32/common/config.h b/win32/common/config.h index ae92de3c5f..5c575c9cb7 100644 --- a/win32/common/config.h +++ b/win32/common/config.h @@ -39,7 +39,7 @@ #define GST_LICENSE "LGPL" /* package name in plugins */ -#define GST_PACKAGE_NAME "GStreamer Base Plug-ins source release" +#define GST_PACKAGE_NAME "GStreamer Base Plug-ins CVS/prerelease" /* package origin */ #define GST_PACKAGE_ORIGIN "Unknown package origin" @@ -211,13 +211,13 @@ #define PACKAGE_NAME "GStreamer Base Plug-ins" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "GStreamer Base Plug-ins 0.10.17" +#define PACKAGE_STRING "GStreamer Base Plug-ins 0.10.17.1" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "gst-plugins-base" /* Define to the version of this package. */ -#define PACKAGE_VERSION "0.10.17" +#define PACKAGE_VERSION "0.10.17.1" /* directory where plugins are located */ #undef PLUGINDIR @@ -241,7 +241,7 @@ #undef STDC_HEADERS /* Version number of package */ -#define VERSION "0.10.17" +#define VERSION "0.10.17.1" /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */