search for: g_source_unref

Displaying 10 results from an estimated 10 matches for "g_source_unref".

2019 Jul 15
2
[PATCH libnbd] examples: Include an example of integrating with the glibc main loop.
** NOT WORKING ** This patch shows how to integrate libnbd and the glib main loop. Posted mainly as a point of discussion as it doesn't quite work yet. Rich.
2019 Jul 17
1
Re: [PATCH libnbd] examples: Include an example of integrating with the glib main loop.
...+ /* If the reader has finished and there are no more buffers then we > + * have done. > + */ > + if (finished && nr_buffers == 0) { > + DEBUG (gsdest, "finished_write: all finished"); > + g_source_remove (g_source_get_id ((GSource *) gssrc)); > + g_source_unref ((GSource *) gssrc); > + gssrc = NULL; > + g_source_remove (g_source_get_id ((GSource *) gsdest)); > + g_source_unref ((GSource *) gsdest); > + gsdest = NULL; > + g_main_loop_quit (loop); > + } > + > + return 0; > +} > -- Eric Blake, Principal Softw...
2019 Jul 15
0
[PATCH libnbd] examples: Include an example of integrating with the glib main loop.
...reader_paused = false; + } + + /* If the reader has finished and there are no more buffers then we + * have done. + */ + if (finished && nr_buffers == 0) { + DEBUG (gsdest, "finished_write: all finished"); + g_source_remove (g_source_get_id ((GSource *) gssrc)); + g_source_unref ((GSource *) gssrc); + gssrc = NULL; + g_source_remove (g_source_get_id ((GSource *) gsdest)); + g_source_unref ((GSource *) gsdest); + gsdest = NULL; + g_main_loop_quit (loop); + } + + return 0; +} -- 2.22.0
2019 Jul 17
0
[PATCH libnbd v2] examples: Include an example of integrating with the glib main loop.
...reader_paused = false; + } + + /* If the reader has finished and there are no more buffers then we + * have done. + */ + if (finished && nr_buffers == 0) { + DEBUG (gsdest, "finished_write: all finished"); + g_source_remove (g_source_get_id ((GSource *) gssrc)); + g_source_unref ((GSource *) gssrc); + gssrc = NULL; + g_source_remove (g_source_get_id ((GSource *) gsdest)); + g_source_unref ((GSource *) gsdest); + gsdest = NULL; + g_main_loop_quit (loop); + } + + return 0; +} -- 2.22.0
2019 Jul 17
2
[PATCH libnbd v2] examples: Include an example of integrating with glib main loop.
This is working now, and incorporates all of the changes in Eric's review, *except* that it still doesn't retire commands (although this seems to make no obvious difference, except possibly a performance and memory impact). Rich.
2007 Mar 26
0
6 commits - doc/swfdec-sections.txt libswfdec-gtk/Makefile.am libswfdec-gtk/swfdec_gtk_player.c libswfdec-gtk/swfdec_gtk_player.h libswfdec/swfdec_loader.c player/swfplay.c swfdec-gtk.pc.in
...fdec_gtk_player.c index b9d65eb..766f92d 100644 --- a/libswfdec-gtk/swfdec_gtk_player.c +++ b/libswfdec-gtk/swfdec_gtk_player.c @@ -241,6 +241,7 @@ swfdec_gtk_player_set_playing (SwfdecGtk } else if (!playing && player->source != NULL) { g_source_destroy (player->source); g_source_unref (player->source); + player->source = NULL; } swfdec_gtk_player_update_audio (player); g_object_notify (G_OBJECT (player), "playing"); diff-tree d05a09d1eaaa7643d01e35be398a11631213eeb1 (from 0268fcbb61254e6868b5fa7e95617204f03e3d35) Author: Benjamin Otte <otte@gnome.o...
2007 Jul 16
0
configure.ac libswfdec-gtk/Makefile.am libswfdec-gtk/swfdec_playback_oss.c
..., (GSourceFunc) handle_stream, stream, + NULL); + g_io_channel_unref (channel); + g_source_attach (stream->source, stream->sound->context); + + return; +} + +static void +swfdec_stream_close (Stream *stream) +{ + close (stream->dsp_fd); + g_source_destroy (stream->source); + g_source_unref (stream->source); + stream->sound->streams = g_list_remove (stream->sound->streams, stream); + g_object_unref (stream->audio); + g_free (stream); +} + +/*** SOUND ***/ + +static void +advance_before (SwfdecPlayer *player, guint msecs, guint audio_samples, gpointer data) +{ + S...
2007 Jan 29
0
3 commits - autogen.sh configure.ac player/.gitignore player/Makefile.am player/swfdec_playback_alsa.c player/swfdec_playback.c player/swfdec_playback_none.c
...%u)\n", stream->offset, (guint) avail); - } - return TRUE; -} - -static void -swfdec_stream_remove_handlers (Stream *stream) -{ - unsigned int i; - - for (i = 0; i < stream->n_sources; i++) { - if (stream->sources[i]) { - g_source_destroy (stream->sources[i]); - g_source_unref (stream->sources[i]); - stream->sources[i] = NULL; - } - } -} - -static void swfdec_stream_start (Stream *stream); -static gboolean -handle_stream (GIOChannel *source, GIOCondition cond, gpointer data) -{ - Stream *stream = data; - snd_pcm_state_t state; - - state = snd_pcm_state...
2007 Mar 27
0
15 commits - configure.ac doc/Makefile.am doc/swfdec-docs.sgml doc/swfdec-sections.txt doc/swfdec.types libswfdec-gtk/.gitignore libswfdec-gtk/Makefile.am libswfdec-gtk/swfdec-gtk.h libswfdec-gtk/swfdec_gtk_player.c libswfdec-gtk/swfdec_gtk_player.h
...me) { @@ -61,20 +57,6 @@ view_swf (SwfdecPlayer *player, double s } static void -play_swf (SwfdecPlayer *player, double speed) -{ - GSource *source; - - source = swfdec_iterate_source_new (player, speed); - g_source_attach (source, NULL); - - gtk_main (); - - g_source_destroy (source); - g_source_unref (source); -} - -static void print_trace (SwfdecPlayer *player, const char *message, gpointer unused) { g_print ("%s\n", message); @@ -133,7 +115,7 @@ main (int argc, char *argv[]) g_error_free (error); return 1; } - player = swfdec_player_new (); + player = swfdec_gtk_...
2007 Jan 31
0
Branch 'interpreter' - 20 commits - autogen.sh configure.ac libswfdec/js libswfdec/swfdec_debug.h libswfdec/swfdec_js.c libswfdec/swfdec_js_color.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_script.c
...%u)\n", stream->offset, (guint) avail); - } - return TRUE; -} - -static void -swfdec_stream_remove_handlers (Stream *stream) -{ - unsigned int i; - - for (i = 0; i < stream->n_sources; i++) { - if (stream->sources[i]) { - g_source_destroy (stream->sources[i]); - g_source_unref (stream->sources[i]); - stream->sources[i] = NULL; - } - } -} - -static void swfdec_stream_start (Stream *stream); -static gboolean -handle_stream (GIOChannel *source, GIOCondition cond, gpointer data) -{ - Stream *stream = data; - snd_pcm_state_t state; - - state = snd_pcm_state...