Package: minbar Version: 0.2.1-3 Severity: important
When minbar uses the audio on a system with pulseaudio installed the sound stops working for all other applications. Conversely if audio is being played by other applications minbar fails to play it's audio. I had reported this problem and a fix to minbar original author a year ago. The problem still exists. I'm sending the patch here. The patch also adds a feature which allows minbar to play all audio supported by gstreamer not just ogg/vorbis. Please apply this patch. --- minbar-0.2.1.orig/src/main.c +++ minbar-0.2.1/src/main.c @@ -74,7 +74,7 @@ static GladeXML * xml; static GError * err = NULL; /* For gstreamer */ -static GstElement *pipeline, *source, *parser, *decoder, *conv, *sink; +static GstElement *pipeline; static GMainLoop *loop; static GstBus *bus; static GtkFileFilter *filter_all; @@ -1004,40 +1004,34 @@ { exit(-1); } - gchar * athanfilename; + gchar * athanuri; /* set filename property on the file source. Also add a message * handler. */ no_stream_errors = TRUE; if(calling_athan_for == 0) { - athanfilename = gtk_file_chooser_get_filename + athanuri = gtk_file_chooser_get_uri ((GtkFileChooser *) (glade_xml_get_widget(xml, "athan_subh_chooser"))); } else { - athanfilename = gtk_file_chooser_get_filename + athanuri = gtk_file_chooser_get_uri ((GtkFileChooser *) (glade_xml_get_widget(xml, "athan_chooser"))); } - g_object_set (G_OBJECT (source), "location", athanfilename, NULL); + g_object_set (G_OBJECT (pipeline), "uri", athanuri, NULL); bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); gst_bus_add_watch (bus, bus_call, loop); gst_object_unref (bus); - /* put all elements in a bin */ - gst_bin_add_many (GST_BIN (pipeline), - source, parser, decoder, conv, sink, NULL); - - /* link together - note that we cannot link the parser and - * decoder yet, becuse the parser uses dynamic pads. For that, - * we set a pad-added signal handler. */ - gst_element_link (source, parser); - gst_element_link_many (decoder, conv, sink, NULL); - g_signal_connect (parser, "pad-added", G_CALLBACK (new_pad), NULL); - /* Now set to playing and iterate. */ gst_element_set_state (pipeline, GST_STATE_PLAYING); + g_main_loop_run (loop); + + /* clean up nicely */ + gst_element_set_state (pipeline, GST_STATE_NULL); + gst_object_unref (GST_OBJECT (pipeline)); } @@ -1070,6 +1064,7 @@ switch (GST_MESSAGE_TYPE (msg)) { case GST_MESSAGE_EOS: /* End of Stream */ + g_main_loop_quit (loop); break; case GST_MESSAGE_ERROR: { gchar *debug; @@ -1081,6 +1076,7 @@ g_print (_("Error: %s\n"), err->message); g_error_free (err); + g_main_loop_quit (loop); no_stream_errors= FALSE; break; } @@ -1114,31 +1110,14 @@ g_free(label_status); } -void new_pad (GstElement *element, - GstPad *pad, - gpointer data) -{ - GstPad *sinkpad; - /* We can now link this pad with the audio decoder */ - sinkpad = gst_element_get_pad (decoder, "sink"); - gst_pad_link (pad, sinkpad); - - gst_object_unref (sinkpad); -} - - int init_pipelines() { /* create elements */ - pipeline = gst_pipeline_new ("audio-player"); - source = gst_element_factory_make ("filesrc", "file-source"); - parser = gst_element_factory_make ("oggdemux", "ogg-parser"); - decoder = gst_element_factory_make ("vorbisdec", "vorbis-decoder"); - conv = gst_element_factory_make ("audioconvert", "converter"); - sink = gst_element_factory_make ("alsasink", "alsa-output"); - if (!pipeline || !source || !parser || !decoder || !conv || !sink) { - g_print ("One element could not be created\n"); + pipeline = gst_element_factory_make ("playbin", "play"); + + if (!pipeline) { + g_print ("pipeline could not be created\n"); return -1; } return 1; @@ -1155,6 +1134,7 @@ gtk_file_filter_set_name (filter_supported, _("Supported files")); gtk_file_filter_add_mime_type (filter_supported, "application/ogg"); + gtk_file_filter_add_mime_type (filter_supported, "audio/*"); g_object_ref (filter_supported); } @@ -1305,6 +1285,8 @@ /* initialize GStreamer */ gst_init (&argc, &argv); + loop = g_main_loop_new (NULL, FALSE); + /* command line options */ GOptionEntry options[] = -- System Information: Debian Release: 5.0 APT prefers jaunty-updates APT policy: (500, 'jaunty-updates'), (500, 'jaunty-security'), (500, 'jaunty') Architecture: amd64 (x86_64) Kernel: Linux 2.6.28-11-generic (SMP w/2 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages minbar depends on: ii gconf2 2.26.0-0ubuntu1 GNOME configuration database syste ii libart-2.0-2 2.3.20-2 Library of functions for 2D graphi ii libatk1.0-0 1.26.0-0ubuntu2 The ATK accessibility toolkit ii libc6 2.9-4ubuntu6 GNU C Library: Shared libraries ii libcairo2 1.8.6-1ubuntu2 The Cairo 2D vector graphics libra ii libdbus-1-3 1.2.12-0ubuntu2 simple interprocess messaging syst ii libdbus-glib-1- 0.80-3 simple interprocess messaging syst ii libfontconfig1 2.6.0-1ubuntu12 generic font configuration library ii libfreetype6 2.3.9-4ubuntu0.1 FreeType 2 font engine, shared lib ii libgconf2-4 2.26.0-0ubuntu1 GNOME configuration database syste ii libglade2-0 1:2.6.4-1 library to load .glade files at ru ii libglib2.0-0 2.20.1-0ubuntu2 The GLib library of C routines ii libgnomecanvas2 2.26.0-0ubuntu1 A powerful object-oriented display ii libgstreamer0.1 0.10.22-1 Core GStreamer libraries and eleme ii libgtk2.0-0 2.16.1-0ubuntu2 The GTK+ graphical user interface ii libitl0 0.6.4-1 Islamic tools & libraries project ii libnotify1 [lib 0.4.5-0ubuntu1 sends desktop notifications to a n ii libpango1.0-0 1.24.1-0ubuntu1 Layout and rendering of internatio ii libxml2 2.6.32.dfsg-5ubuntu4 GNOME XML library ii zlib1g 1:1.2.3.3.dfsg-12ubuntu2 compression library - runtime minbar recommends no packages. minbar suggests no packages. -- no debconf information -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org