diff -r a6ac25bf88a7 -r 2b4e9d183146 gst-gmyth/playbinmaemo/gstplaybinmaemo.c --- a/gst-gmyth/playbinmaemo/gstplaybinmaemo.c Thu Aug 02 14:58:15 2007 +0100 +++ b/gst-gmyth/playbinmaemo/gstplaybinmaemo.c Fri Aug 03 21:43:42 2007 +0100 @@ -86,15 +86,6 @@ static gboolean autoplug_continue_cb (GstElement* object, GstCaps* caps, gpointer user_data); -static void decode_new_pad_cb (GstElement *element, - GObject *new_pad, - gpointer user_data); -static void queue_underrun_cb (GstElement* queue, - gpointer user_data); -static void queue_sink_underrun_cb (GstElement* queue, - gpointer user_data); -static void queue_sink_overrun_cb (GstElement* queue, - gpointer user_data); static gboolean add_element (GstPlayBinMaemo *pbm, GstElement *child); static void clear_elements (GstPlayBinMaemo *pbm); @@ -131,8 +122,8 @@ NULL, G_PARAM_READWRITE)); g_object_class_install_property (gobject_klass, ARG_VOLUME, - g_param_spec_uint ("volume", "Audio volume", "volume", - 0, 10, (guint) DEFAULT_VOLUME, G_PARAM_READWRITE)); + g_param_spec_double ("volume", "Audio volume", "volume", + 0.0, 10.0, (gdouble) DEFAULT_VOLUME, G_PARAM_READWRITE)); g_object_class_install_property (gobject_klass, ARG_XID, g_param_spec_long ("xid", "xid", "X windown ID", @@ -216,10 +207,12 @@ static const gchar *blacklisted_uris[] = { NULL }; /* mime types that we don't consider to be media types */ +/* static const gchar *no_media_mimes[] = { "application/x-executable", "application/x-bzip", "application/x-gzip", "application/zip", "application/x-compress", NULL }; +*/ /* mime types we consider raw media */ static const gchar *raw_mimes[] = { @@ -289,9 +282,9 @@ /* whoops, could not create the source element, dig a little deeper to * figure out what might be wrong. */ if (prot) { + /* gchar *desc; - /* gst_element_post_message (GST_ELEMENT (play_bin_maemo), gst_missing_uri_source_message_new (GST_ELEMENT (play_bin_maemo), prot)); @@ -300,8 +293,8 @@ GST_ELEMENT_ERROR (play_bin_maemo, CORE, MISSING_PLUGIN, (_("A %s plugin is required to play this stream, but not installed."), desc), ("No URI handler for %s", prot)); - */ g_free (desc); + */ g_free (prot); } else goto invalid_uri; @@ -344,9 +337,6 @@ static gboolean setup_source (GstPlayBinMaemo *pbm) { - GstIterator *childs; - GstState state; - if (!pbm->need_rebuild) return TRUE; @@ -414,14 +404,18 @@ } case ARG_VOLUME: { - guint volume = 0; - volume = g_value_get_uint (value); - if (volume != 0) { - volume = (guint) (65535 * volume / 10); + gdouble d_volume = 0; + guint u_volume = 0; + d_volume = g_value_get_double (value); + + g_debug ("Getting : %5.2f", d_volume); + if (d_volume != 0) { + u_volume = (guint) (65535 * d_volume); } - if (play_bin_maemo->volume != volume) { - play_bin_maemo->volume = volume; + g_debug ("Converting : %d", u_volume); + if (play_bin_maemo->volume != u_volume) { + play_bin_maemo->volume = u_volume; update_volume (play_bin_maemo); } break; @@ -465,11 +459,11 @@ break; case ARG_VOLUME: { - guint volume = 0; + gdouble volume = 0; if (play_bin_maemo->volume > 0) { - volume = 10 * play_bin_maemo->volume / 65535; + volume = play_bin_maemo->volume / 65535; } - g_value_set_uint (value, volume); + g_value_set_double (value, volume); break; } case ARG_XID: @@ -799,7 +793,7 @@ for (walk=comp; walk != NULL; walk = walk->next) { GstElementFactory *factory = (GstElementFactory *) walk->data; GstElement *element; - GstPad *sinkpad; + GstPad *sinkpad = NULL; if ((element = create_element (pbm, factory)) == NULL) { GST_WARNING_OBJECT (pbm, "Could not create an element from %s",