Permalink
Browse files

firewire: Move update_port_latencies() further up the file

Instead of introducing a prototype declaration, let's move the function so it
can be used by ffado_driver_attach().
  • Loading branch information...
1 parent 6a7a11c commit b4e09a119c50e3ea5948ea5a87067a22e2dfafab @adiknoth committed Apr 2, 2012
Showing with 25 additions and 25 deletions.
  1. +25 −25 drivers/firewire/ffado_driver.c
@@ -68,6 +68,31 @@ extern int ffado_streaming_set_period_size(ffado_device_t *dev,
// enable verbose messages
static int g_verbose=0;
+static void update_port_latencies(ffado_driver_t *driver)
+{
+ JSList *node;
+ jack_latency_range_t range;
+
+ range.min = range.max = (driver->period_size * (driver->device_options.nb_buffers - 1));
+ for (node = driver->playback_ports; node;
+ node = jack_slist_next (node)) {
+ if (node->data != NULL) {
+ jack_port_t *port = (jack_port_t *) node->data;
+ jack_port_set_latency_range (port, JackPlaybackLatency, &range);
+ }
+ }
+
+ range.min = range.max = driver->period_size + driver->capture_frame_latency;
+ for (node = driver->capture_ports; node;
+ node = jack_slist_next (node)) {
+ if (node->data != NULL) {
+ jack_port_t *port = (jack_port_t *) node->data;
+ jack_port_set_latency_range (port, JackCaptureLatency, &range);
+ }
+
+ }
+}
+
static int
ffado_driver_attach (ffado_driver_t *driver)
{
@@ -684,31 +709,6 @@ ffado_driver_stop (ffado_driver_t *driver)
return 0;
}
-static void update_port_latencies(ffado_driver_t *driver)
-{
- JSList *node;
- jack_latency_range_t range;
-
- range.min = range.max = (driver->period_size * (driver->device_options.nb_buffers - 1));
- for (node = driver->playback_ports; node;
- node = jack_slist_next (node)) {
- if (node->data != NULL) {
- jack_port_t *port = (jack_port_t *) node->data;
- jack_port_set_latency_range (port, JackPlaybackLatency, &range);
- }
- }
-
- range.min = range.max = driver->period_size + driver->capture_frame_latency;
- for (node = driver->capture_ports; node;
- node = jack_slist_next (node)) {
- if (node->data != NULL) {
- jack_port_t *port = (jack_port_t *) node->data;
- jack_port_set_latency_range (port, JackCaptureLatency, &range);
- }
-
- }
-}
-
static int
ffado_driver_bufsize (ffado_driver_t* driver, jack_nframes_t nframes)
{

0 comments on commit b4e09a1

Please sign in to comment.