Commit 4fd77c19 authored by Wim Taymans's avatar Wim Taymans

The timeout handler should have lower priority than the source so we don't...

The timeout handler should have lower priority than the source so we don't timeout before popping a message with 0 ti...

Original commit message from CVS:
* gst/gstbus.c: (poll_func), (poll_timeout), (gst_bus_poll):
* tools/gst-launch.c: (main):
The timeout handler should have lower priority than the source
so we don't timeout before popping a message with 0 timeout.
Dump error messages after failed state change.
parent d30a4eb9
2005-09-20 Wim Taymans <wim@fluendo.com>
* gst/gstbus.c: (poll_func), (poll_timeout), (gst_bus_poll):
* tools/gst-launch.c: (main):
The timeout handler should have lower priority than the source
so we don't timeout before popping a message with 0 timeout.
Dump error messages after failed state change.
2005-09-20 Tim-Philipp Müller <tim at centricular dot net>
* tools/gst-inspect.c: (print_element_properties_info):
......
......@@ -657,13 +657,16 @@ typedef struct
static gboolean
poll_func (GstBus * bus, GstMessage * message, GstBusPollData * poll_data)
{
if (!g_main_loop_is_running (poll_data->loop))
if (!g_main_loop_is_running (poll_data->loop)) {
GST_DEBUG ("mainloop %p not running", poll_data->loop);
return TRUE;
}
if (GST_MESSAGE_TYPE (message) & poll_data->events) {
g_return_val_if_fail (poll_data->message == NULL, FALSE);
/* keep ref to message */
poll_data->message = gst_message_ref (message);
GST_DEBUG ("mainloop %p quit", poll_data->loop);
g_main_loop_quit (poll_data->loop);
} else {
/* don't remove the source. */
......@@ -676,6 +679,7 @@ poll_func (GstBus * bus, GstMessage * message, GstBusPollData * poll_data)
static gboolean
poll_timeout (GstBusPollData * poll_data)
{
GST_DEBUG ("mainloop %p quit", poll_data->loop);
g_main_loop_quit (poll_data->loop);
/* we don't remove the GSource as this would free our poll_data,
......@@ -739,10 +743,12 @@ gst_bus_poll (GstBus * bus, GstMessageType events, GstClockTimeDiff timeout)
else
poll_data->timeout_id = 0;
id = gst_bus_add_watch_full (bus, G_PRIORITY_DEFAULT_IDLE, GST_MESSAGE_ANY,
id = gst_bus_add_watch_full (bus, G_PRIORITY_DEFAULT, GST_MESSAGE_ANY,
(GstBusFunc) poll_func, poll_data, (GDestroyNotify) poll_destroy);
GST_DEBUG ("running mainloop %p", poll_data->loop);
g_main_loop_run (poll_data->loop);
GST_DEBUG ("mainloop stopped %p", poll_data->loop);
/* holds a ref */
ret = poll_data->message;
......
......@@ -609,6 +609,7 @@ main (int argc, char *argv[])
case GST_STATE_CHANGE_FAILURE:
fprintf (stderr, _("ERROR: pipeline doesn't want to pause.\n"));
res = -1;
event_loop (pipeline, FALSE);
goto end;
case GST_STATE_CHANGE_NO_PREROLL:
fprintf (stderr, _("NO_PREROLL pipeline ...\n"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment