From: John Melton - G0ORX/N6LYT Date: Wed, 13 Jul 2016 14:15:38 +0000 (+0000) Subject: fixed race condition when enabling local audio from menu X-Git-Url: https://git.rkrishnan.org/pf/components/$rel_link?a=commitdiff_plain;h=749a84afdc9242164400036a1b66ba3ed47b2c25;p=pihpsdr.git fixed race condition when enabling local audio from menu --- diff --git a/menu.c b/menu.c index caf4082..7536cc4 100644 --- a/menu.c +++ b/menu.c @@ -131,14 +131,13 @@ static void micboost_cb(GtkWidget *widget, gpointer data) { } static void local_audio_cb(GtkWidget *widget, gpointer data) { - local_audio=local_audio==1?0:1; if(local_audio) { - if(audio_init()!=0) { - fprintf(stderr,"audio_init failed\n"); - local_audio=0; - } - } else { + local_audio=0; audio_close(); + } else { + if(audio_init()==0) { + local_audio=1; + } } } diff --git a/pihpsdr b/pihpsdr index 3d72ae3..5c968ed 100755 Binary files a/pihpsdr and b/pihpsdr differ diff --git a/release/pihpsdr.tar b/release/pihpsdr.tar index e37f316..1b8a295 100644 Binary files a/release/pihpsdr.tar and b/release/pihpsdr.tar differ diff --git a/release/pihpsdr/pihpsdr b/release/pihpsdr/pihpsdr index 28029f4..5c968ed 100755 Binary files a/release/pihpsdr/pihpsdr and b/release/pihpsdr/pihpsdr differ