From: P. F. Chimento Date: Sun, 30 Jan 2011 00:13:23 +0000 (+0100) Subject: Working on sound support X-Git-Tag: v0.9~152^2~10 X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=37afe8768ae9031937291854e0866c10cbe2c0d4;p=projects%2Fchimara%2Fchimara.git Working on sound support Playing sounds more than once now works, but not playing an AIFF sound after an OGG sound or vice versa. --- diff --git a/libchimara/schannel.c b/libchimara/schannel.c index e0695b8..3e33f23 100644 --- a/libchimara/schannel.c +++ b/libchimara/schannel.c @@ -18,10 +18,11 @@ extern GPrivate *glk_data_key; static void on_pipeline_message(GstBus *bus, GstMessage *message, schanid_t s) { - /* g_print("Got %s message\n", GST_MESSAGE_TYPE_NAME(message)); */ + g_print("Got %s message\n", GST_MESSAGE_TYPE_NAME(message)); switch(GST_MESSAGE_TYPE(message)) { - case GST_MESSAGE_ERROR: { + case GST_MESSAGE_ERROR: + { GError *err; gchar *debug; @@ -29,10 +30,22 @@ on_pipeline_message(GstBus *bus, GstMessage *message, schanid_t s) g_print("Error: %s\n", err->message); g_error_free(err); g_free(debug); + } break; + case GST_MESSAGE_STATE_CHANGED: + { + GstState old_state, new_state; + gst_message_parse_state_changed(message, &old_state, &new_state, NULL); + g_print("Element %s changed state from %s to %s.\n", + GST_OBJECT_NAME(message->src), + gst_element_state_get_name(old_state), + gst_element_state_get_name(new_state)); } + break; case GST_MESSAGE_EOS: /* end-of-stream */ + if(!gst_element_set_state(s->pipeline, GST_STATE_READY)) + WARNING_S(_("Could not set GstElement state to"), "READY"); break; default: /* unhandled message */