Parcourir la source

More atemps for fixing the streamer..

jancoow il y a 9 ans
Parent
commit
cad3066a10
4 fichiers modifiés avec 8 ajouts et 4 suppressions
  1. 1 2
      contentparser.c
  2. 5 0
      httpstream.c
  3. 1 1
      httpstream.h
  4. 1 1
      vs10xx.c

+ 1 - 2
contentparser.c

@@ -132,9 +132,7 @@ void parseCommandQue(char* content){
         if (jsoneq(content, &token[i], "command") == 0) {
             if(jsoneq(content, &token[i + 1], "volume") == 0){
                 char vol = getIntegerToken(content, &token[i + 3]);
-                printf("%d", vol);
                 vol = 128 - ((vol * 128) / 100);
-                printf("%d", vol);
                 VsSetVolume(vol, vol);
                 i += 3;
             }else if(jsoneq(content, &token[i + 1], "stopstream") == 0){
@@ -156,5 +154,6 @@ void parseCommandQue(char* content){
 void parsetimezone(char* content)
 {
     int timezone = atoi(content);
+    setTimeZone(timezone);
     printf("%d", timezone);
 }

+ 5 - 0
httpstream.c

@@ -109,6 +109,10 @@ void ConnectStation(TCPSOCKET *sock, u_long ip, u_short port, char *radiourl, u_
      * Receive the HTTP header.
      */
     line = malloc(MAX_HEADERLINE);
+    if(line == 0){
+        printf("Can't malloc memory in httpstream\n");
+        return;
+    }
     while(fgets(line, MAX_HEADERLINE, stream)) {
 
         /*
@@ -161,6 +165,7 @@ int ProcessMetaData(FILE *stream)
 
         cnt = blks * 16;
         if ((mbuf = malloc(cnt + 1)) == 0) {
+            printf("Can't malloc memory for metadata parsing\n");
             return -1;
         }
 

+ 1 - 1
httpstream.h

@@ -8,7 +8,7 @@
 #include "ntp.h"
 
 #define MAX_HEADERLINE 512
-#define MSS 1460
+#define MSS 536
 #define RX_TO 3000
 #define TCPBUFSIZE 8760
 

+ 1 - 1
vs10xx.c

@@ -505,7 +505,7 @@ int VsPlayerKick(void)
          *  for the VS1003 we need an extra reset
          *  here before we start playing a stream...
          */
-        VsPlayerSetMode(VS_SM_RESET);
+//        VsPlayerSetMode(VS_SM_RESET);
 //        NutDelay(10);
 //        LogMsg_P(LOG_DEBUG,PSTR("Kick: CLOCKF = [0x%02X]"),VsRegRead(VS_CLOCKF_REG));
 //        LogMsg_P(LOG_DEBUG,PSTR("Kick: CLOCKF = [0x%02X]"),VsRegRead(VS_CLOCKF_REG));