I've attached the source for my test program. It compiles with Gtk2. I'm using gstreamer, gstreamer-plugins, and monkey-media from CVS. Gstreamer says it's version 0.4.0.1. GnomeVFS is 2.0. When I call monkey_media_mixer_set_state (mixer, MONKEY_MEDIA_MIXER_STATE_STOPPED); it releases the gnomevfssrc, which crashes in gnome_vfs_uri_unref (). In the learned opinions of the list denizens, is this a gstreamer problem, or a gnomevfs problem? Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1026 (LWP 8248)] 0x40308820 in gnome_vfs_uri_unref () from /usr/lib/libgnomevfs-2.so.0 (gdb) bt #0 0x40308820 in gnome_vfs_uri_unref () from /usr/lib/libgnomevfs-2.so.0 #1 0x402f4378 in gnome_vfs_handle_destroy () from /usr/lib/libgnomevfs-2.so.0 #2 0x40aa1b1c in gst_gnomevfssrc_close_file (src=0x80fc940) at gstgnomevfssrc.c:543 #3 0x40aa1c9f in gst_gnomevfssrc_change_state (element=0x80a5468) at gstgnomevfssrc.c:574 #4 0x402ad864 in gst_element_set_state (element=0x80a5468, state=GST_STATE_READY) at gstelement.c:1931 #5 0x402a44c6 in gst_bin_change_state (element=0x80a4510) at gstbin.c:533 #6 0x402ad864 in gst_element_set_state (element=0x80a4510, state=GST_STATE_READY) at gstelement.c:1931 #7 0x402a44c6 in gst_bin_change_state (element=0x809e888) at gstbin.c:533 #8 0x402c0ddb in gst_thread_update_state (thread=0x809e888) at gstthread.c:286 #9 0x402c2c6a in gst_thread_main_loop (arg=0x809e888) at gstthread.c:619 #10 0x405bb7e1 in pthread_start_thread () from /lib/i686/libpthread.so.0 #11 0x405bb8e5 in pthread_start_thread_event () from /lib/i686/libpthread.so.0 -- Michael Rothwell e: rothwell at holly-springs.nc.us k: http://www.flyingbuttmonkeys.com/rothwell-public-key.txt
#include <gtk/gtk.h> #include <stdlib.h> #include <monkey-media.h> /******************************************************** * globals ********************************************************/ GtkWidget *window, *label, *label2, *hbox; guint iterator_id; MonkeyMediaMixer *mixer; MonkeyMediaAudioStream *stream; GError *error = NULL; /******************************************************** * prototypes ********************************************************/ void init_monkeymedia(void); static gint key_callback( GtkWidget *widget, GdkEventButton *event, gpointer data ); gboolean timer_callback(gpointer *data); static void monkey_media_mixer_end_of_queue_cb (MonkeyMediaMixer *mixer, gpointer unused); /******************************************************** * main ********************************************************/ int main (int argc, char **argv) { iterator_id = 0; monkey_media_init (&argc, &argv); gtk_init (&argc, &argv); init_monkeymedia(); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size(window,640,480); g_signal_connect(window,"key_press_event", key_callback, NULL); hbox = gtk_hbox_new(TRUE,0); gtk_container_add(window,hbox); label = gtk_label_new("label"); gtk_container_add(hbox,label); label2 = gtk_label_new("label2"); gtk_container_add(hbox,label2); gtk_widget_show_all(window); gtk_timeout_add(100,timer_callback,NULL); gtk_main(); exit(0); }; /******************************************************** * key_callback ********************************************************/ static gint key_callback( GtkWidget *widget, GdkEventButton *event, gpointer data ) { printf("\nkey pressed\n"); if (iterator_id == 0 ) { iterator_id = 1; printf("starting\n"); monkey_media_mixer_set_state (mixer, MONKEY_MEDIA_MIXER_STATE_PLAYING); } else { iterator_id = 0; printf("stopping\n"); monkey_media_mixer_set_state (mixer, MONKEY_MEDIA_MIXER_STATE_STOPPED); }; }; /******************************************************** * init_monkeymedia ********************************************************/ void init_monkeymedia(void) { mixer = monkey_media_mixer_new (&error); g_signal_connect (G_OBJECT (mixer), "end_of_queue", G_CALLBACK (monkey_media_mixer_end_of_queue_cb), NULL); stream = monkey_media_audio_stream_new ("http://kronk/mp3/dukes.mp3", &error); monkey_media_mixer_append_audio_stream (mixer, stream); }; /******************************************************** * timer_callback ********************************************************/ gboolean timer_callback(gpointer *data) { gchar stime[512]; GTimeVal t; g_get_current_time(&t); sprintf(stime,"%d.%d",t.tv_sec,t.tv_usec); gtk_label_set_text(label2,stime); return TRUE; }; /******************************************************** * monkey_media_mixer_end_of_queue_cb ********************************************************/ static void monkey_media_mixer_end_of_queue_cb (MonkeyMediaMixer *mixer, gpointer unused) { printf ("Audio finished."); monkey_media_main_quit (); }
#PREFIX = /usr PKG_CONFIG_PATH = $(PREFIX)lib/pkgconfig/ INCLUDES = `pkg-config monkey-media --cflags` `pkg-config gtk+-2.0 --cflags` LIBS = `pkg-config monkey-media --libs` `pkg-config gtk+-2.0 --libs` #ENV = env PKG_CONFIG_PATH=$(PKGCONFIGPATH) all: gst-test guiapp clean: rm -f core *.o gst-test guiapp guiapp: guiapp.c $(ENV) gcc -o guiapp guiapp.c $(INCLUDES) $(LIBS) gst-test: gst-test.c $(ENV) gcc -o gst-test gst-test.c $(INCLUDES) $(LIBS)
Attachment:
signature.asc
Description: This is a digitally signed message part