Working on sound support
authorP. F. Chimento <philip.chimento@gmail.com>
Sun, 30 Jan 2011 00:13:23 +0000 (01:13 +0100)
committerP. F. Chimento <philip.chimento@gmail.com>
Sun, 30 Jan 2011 00:13:23 +0000 (01:13 +0100)
Playing sounds more than once now works, but not playing an AIFF sound
after an OGG sound or vice versa.

libchimara/schannel.c

index e0695b82390db831f33d3915ef3205df5bb48ca5..3e33f235256887b128a813cf9fc00c5308f6681b 100644 (file)
@@ -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 */