From e7cb1162a433cffb3a50eecad10f75aaee3ab434 Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 13 Dec 2016 17:07:09 +0100 Subject: [PATCH] transport.c: save the first tick as double --- transport.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/transport.c b/transport.c index 9cc80cc..b96179d 100644 --- a/transport.c +++ b/transport.c @@ -79,13 +79,11 @@ void timebase(jack_transport_state_t state, jack_nframes_t nframes, pos->bar = abs_beat / pos->beats_per_bar; pos->beat = abs_beat - (pos->bar * pos->beats_per_bar) + 1; - pos->tick = abs_tick - (abs_beat * pos->ticks_per_beat); + last_tick = abs_tick - (abs_beat * pos->ticks_per_beat); pos->bar_start_tick = pos->bar * pos->beats_per_bar * pos->ticks_per_beat; pos->bar++; /* adjust start to bar 1 */ - last_tick = pos->tick; - #if 0 /* some debug code... */ fprintf(stderr, "\nnew position: %" PRIu32 "\tBBT: %3" @@ -110,10 +108,10 @@ void timebase(jack_transport_state_t state, jack_nframes_t nframes, * pos->ticks_per_beat; } } - - pos->tick = (int)(last_tick + 0.5); } + pos->tick = (int)(last_tick + 0.5); + if (avr_set) { pos->valid |= JackAudioVideoRatio; pos->audio_frames_per_video_frame = audio_frames_per_video_frame;