]> Johnzone git - FakeRadio.git/commitdiff
tweak delays, remove unneccessary output
authorJohn Janus <mail@johnzone.org>
Fri, 6 Oct 2017 22:01:58 +0000 (00:01 +0200)
committerJohn Janus <mail@johnzone.org>
Fri, 6 Oct 2017 22:01:58 +0000 (00:01 +0200)
mp3player.c
simple_try.c

index 08e16328fa37fe93d326025080b4ebbcd73041ee..7dd4c4f38d00d39b4473eac1dcd5dc318bc4efff 100644 (file)
@@ -62,12 +62,9 @@ static void* playFunc(void* arg)
     bool running = true;
     playermem* mem = (playermem*) malloc(sizeof(playermem));
     playersettings* settings = (playersettings*) arg;
-    //mpg123_handle* mh;
-    //unsigned char* buffer;
     int err;
     
     int driver;
-    //ao_device* aodev;
     ao_sample_format format;
     int channels;
     int encoding;
@@ -86,8 +83,8 @@ static void* playFunc(void* arg)
     format.channels = channels;
     format.byte_format = AO_FMT_NATIVE;
     format.matrix = 0;
-    ao_option options = {"debug","",NULL};
-    mem->aodev = ao_open_live(driver, &format, &options);
+    //ao_option options = {"debug","",NULL};
+    mem->aodev = ao_open_live(driver, &format, NULL);//&options);
     mem->queue = create_fifo(5);
     decodeData dd;
     dd.file = settings->file;
@@ -95,19 +92,9 @@ static void* playFunc(void* arg)
     dd.mh = mem->mh;
     pthread_create(&mem->decode_thread, NULL, decodeFunc, &dd);
     pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
-//     do {
-        while (running)
+    
+    while (running)
         {
-
-//             int mpg123ret = mpg123_read(mem->mh, mem->buffer, buffer_size, &done);
-//             if ( mpg123ret == MPG123_DONE && settings->loop) {
-//                 mpg123_open(mem->mh, settings->file);
-//                 continue;
-//                 //mpg123_read(mem->mh, mem->buffer, buffer_size, &done);
-//             } else if (mpg123ret != MPG123_OK) {
-//                 break;
-//             }
-//             ao_play(mem->aodev, fifo_pop(f), done);
             unsigned char* buffer;
             size_t done;
             fifo_pop(mem->queue, &buffer, &done);
@@ -115,8 +102,6 @@ static void* playFunc(void* arg)
             free(buffer);
             pthread_testcancel();
         }
-//     } while (settings->loop);
-    
     pthread_cleanup_pop(1);
     pthread_exit((void*) pthread_self());
 }
index aaf0e98e1a04668dc778be89a349e3583a14ba94..617f7ff0f04802f7778708bc2a1081cd1791405b 100644 (file)
@@ -19,8 +19,8 @@
 #define INTROBTN 13
 #define HORNBTN 11
 
-#define UNPRELL 300
-#define LOOPDELAY 500
+#define UNPRELL 250
+#define LOOPDELAY 600
 
 volatile bool running = true;
 static volatile bool pwrOn = false;