From c2b6b06e2cb33ba7966c6f16154788fc1d7ce6eb Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Tue, 30 Sep 2003 12:56:27 +0000 Subject: conform to the buffer-frames props entry -- much nicer now... Original commit message from CVS: conform to the buffer-frames props entry -- much nicer now... --- ext/jack/gstjackbin.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'ext/jack/gstjackbin.c') diff --git a/ext/jack/gstjackbin.c b/ext/jack/gstjackbin.c index 959f5867..01713a70 100644 --- a/ext/jack/gstjackbin.c +++ b/ext/jack/gstjackbin.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset: 4 -*- */ /* - Copyright (C) 2002 Andy Wingo + Copyright (C) 2002, 2003 Andy Wingo This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public @@ -33,6 +33,7 @@ static GstElementStateReturn gst_jack_bin_change_state(GstElement *element); /* jack callbacks */ static int process (jack_nframes_t nframes, void *arg); static int sample_rate (jack_nframes_t nframes, void *arg); +static int buffer_size (jack_nframes_t nframes, void *arg); static void shutdown (void *arg); static void sighup_handler (int sig); @@ -133,6 +134,8 @@ gst_jack_bin_change_state (GstElement *element) jack_set_process_callback (this->client, process, this); jack_set_sample_rate_callback (this->client, sample_rate, this); + jack_set_buffer_size_callback (this->client, buffer_size, this); + this->nframes = jack_get_buffer_size (this->client); jack_on_shutdown (this->client, shutdown, this); } @@ -291,6 +294,15 @@ sample_rate (jack_nframes_t nframes, void *arg) return 0; } +static int +buffer_size (jack_nframes_t nframes, void *arg) +{ + GstJackBin *bin = (GstJackBin*) arg; + JACK_DEBUG ("the buffer size is now %lu\n", nframes); + bin->nframes = nframes; + return 0; +} + static void shutdown (void *arg) { -- cgit v1.2.1