Skip to content

Commit

Permalink
Update code
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill Farmer committed Mar 23, 2020
1 parent 8aa1db9 commit c481491
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion linux/tuner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,14 @@ void *readAudio(void *)

while (!audio.done)
{
// Get the data
if ((frames = snd_pcm_readi(audio.handle, data, STEP)) < 0)
break;

// Check if done
if (audio.done)
break;

// Copy the input data
memmove(buffer, buffer + STEP, (SAMPLES - STEP) * sizeof(double));

Expand Down Expand Up @@ -986,7 +991,7 @@ void cairo_centre_text(cairo_t *cr, char *t)
cairo_get_current_point(cr, &x, &y);
cairo_text_extents(cr, t, &extents);

cairo_move_to(cr, x - extents.width / 2, y);
cairo_move_to(cr, x - extents.x_advance / 2, y);
cairo_show_text(cr, t);
}

Expand Down

0 comments on commit c481491

Please sign in to comment.