remove the dreaded client->control->nframes which is initialized too late

git-svn-id: svn+ssh://jackaudio.org/trunk/jack@4464 0c269be4-1314-0410-8aa9-9f06e86f4224
This commit is contained in:
torben 2011-06-19 22:10:03 +00:00
parent 787e87941b
commit 9872b17c1f
5 changed files with 10 additions and 20 deletions

View File

@ -256,7 +256,6 @@ typedef volatile struct {
volatile jack_client_id_t id; /* w: engine r: engine and client */
volatile jack_client_id_t uid; /* w: engine r: engine and client */
volatile jack_nframes_t nframes; /* w: engine r: client */
volatile jack_client_state_t state; /* w: engine and client r: engine */
volatile char name[JACK_CLIENT_NAME_SIZE];
volatile char session_command[JACK_PORT_NAME_SIZE];

View File

@ -530,14 +530,6 @@ jack_driver_buffer_size (jack_engine_t *engine, jack_nframes_t nframes)
}
}
/* update shared client copy of nframes */
jack_lock_graph (engine);
for (node = engine->clients; node; node = jack_slist_next (node)) {
jack_client_internal_t *client = node->data;
client->control->nframes = nframes;
}
jack_unlock_graph (engine);
event.type = BufferSizeChange;
jack_deliver_event_to_all (engine, &event);
@ -847,7 +839,6 @@ jack_engine_process (jack_engine_t *engine, jack_nframes_t nframes)
jack_client_control_t *ctl =
((jack_client_internal_t *) node->data)->control;
ctl->state = NotTriggered;
ctl->nframes = nframes;
ctl->timed_out = 0;
ctl->awake_at = 0;
ctl->finished_at = 0;

View File

@ -1781,7 +1781,7 @@ jack_client_process_events (jack_client_t* client)
case SampleRateChange:
if (control->srate_cbset) {
status = client->srate
(control->nframes,
(client->engine->current_time.frame_rate,
client->srate_arg);
}
break;
@ -2015,7 +2015,7 @@ jack_thread_first_wait (jack_client_t* client)
if (jack_client_core_wait (client)) {
return 0;
}
return client->control->nframes;
return client->engine->buffer_size;
}
static void
@ -2042,7 +2042,7 @@ jack_client_thread_aux (void *arg)
/* wait for first wakeup from server */
if (jack_thread_first_wait (client) == control->nframes) {
if (jack_thread_first_wait (client) == client->engine->buffer_size) {
/* now run till we're done */
@ -2052,9 +2052,9 @@ jack_client_thread_aux (void *arg)
while (1) {
DEBUG("client calls process()");
int status = (client->process (control->nframes,
int status = (client->process (client->engine->buffer_size,
client->process_arg) ==
control->nframes);
client->engine->buffer_size);
control->state = Finished;
DEBUG("client leaves process(), re-enters wait");
if (!jack_thread_wait (client, status)) {
@ -2065,7 +2065,7 @@ jack_client_thread_aux (void *arg)
} else {
/* no process handling but still need to process events */
while (jack_thread_wait (client, 0) == control->nframes)
while (jack_thread_wait (client, 0) == client->engine->buffer_size)
;
}
}
@ -2179,7 +2179,7 @@ jack_thread_wait (jack_client_t* client, int status)
if (client->control->sync_cb_cbset)
jack_call_sync_client (client);
return client->control->nframes;
return client->engine->buffer_size;
}
jack_nframes_t jack_cycle_wait (jack_client_t* client)
@ -2219,7 +2219,7 @@ jack_nframes_t jack_cycle_wait (jack_client_t* client)
jack_call_sync_client (client);
}
return client->control->nframes;
return client->engine->buffer_size;
}
void jack_cycle_signal (jack_client_t* client, int status)

View File

@ -230,7 +230,7 @@ jack_port_type_get_buffer_size (jack_client_t *client, const char *port_type)
if (i==client->engine->n_port_types)
return 0;
return jack_port_type_buffer_size (&(client->engine->port_types[i]), client->control->nframes);
return jack_port_type_buffer_size (&(client->engine->port_types[i]), client->engine->buffer_size);
}
jack_port_t *

View File

@ -170,7 +170,7 @@ jack_call_timebase_master (jack_client_t *client)
new_pos) {
client->timebase_cb (ectl->transport_state,
control->nframes,
ectl->buffer_size,
&ectl->pending_time,
new_pos,
client->timebase_arg);