[pulseaudio-commits] r2407 - in /branches/coling/airtunes/src/modules/rtp: base64.c headerlist.c raop_client.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Sun May 11 08:34:38 PDT 2008


Author: coling
Date: Sun May 11 17:34:37 2008
New Revision: 2407

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2407&root=pulseaudio&view=rev
Log:
Some misc fixes. consts, base64 optimisation (not that it will be with us long anyway), and c comments

Modified:
    branches/coling/airtunes/src/modules/rtp/base64.c
    branches/coling/airtunes/src/modules/rtp/headerlist.c
    branches/coling/airtunes/src/modules/rtp/raop_client.c

Modified: branches/coling/airtunes/src/modules/rtp/base64.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/coling/airtunes/src/modules/rtp/base64.c?rev=2407&root=pulseaudio&r1=2406&r2=2407&view=diff
==============================================================================
--- branches/coling/airtunes/src/modules/rtp/base64.c (original)
+++ branches/coling/airtunes/src/modules/rtp/base64.c Sun May 11 17:34:37 2008
@@ -37,16 +37,16 @@
 
 #include "base64.h"
 
-static char base64_chars[] =
+static const char base64_chars[] =
     "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
 
 static int pos(char c)
 {
-    char *p;
-    for (p = base64_chars; *p; p++)
-        if (*p == c)
-            return p - base64_chars;
-    return -1;
+    if (c >= 'A' && c <= 'Z') return c - 'A' + 0;
+    if (c >= 'a' && c <= 'z') return c - 'a' + 26;
+    if (c >= '0' && c <= '9') return c - '0' + 52;
+    if (c == '+') return 62;
+    if (c == '/') return 63;
 }
 
 int pa_base64_encode(const void *data, int size, char **str)

Modified: branches/coling/airtunes/src/modules/rtp/headerlist.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/coling/airtunes/src/modules/rtp/headerlist.c?rev=2407&root=pulseaudio&r1=2406&r2=2407&view=diff
==============================================================================
--- branches/coling/airtunes/src/modules/rtp/headerlist.c (original)
+++ branches/coling/airtunes/src/modules/rtp/headerlist.c Sun May 11 17:34:37 2008
@@ -102,7 +102,7 @@
         hdr->value = pa_xstrdup(value);
         add = TRUE;
     } else {
-        void *newval = (void*)pa_sprintf_malloc("%s%s", (char*)hdr->value, value);
+        void *newval = pa_sprintf_malloc("%s%s", (char*)hdr->value, value);
         pa_xfree(hdr->value);
         hdr->value = newval;
     }

Modified: branches/coling/airtunes/src/modules/rtp/raop_client.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/coling/airtunes/src/modules/rtp/raop_client.c?rev=2407&root=pulseaudio&r1=2406&r2=2407&view=diff
==============================================================================
--- branches/coling/airtunes/src/modules/rtp/raop_client.c (original)
+++ branches/coling/airtunes/src/modules/rtp/raop_client.c Sun May 11 17:34:37 2008
@@ -461,13 +461,13 @@
     /* Now write the actual samples */
     bp = b + header_size;
     size = bpos = 0;
-    bit_writer(&bp,&bpos,&size,1,3); // channel=1, stereo
-    bit_writer(&bp,&bpos,&size,0,4); // unknown
-    bit_writer(&bp,&bpos,&size,0,8); // unknown
-    bit_writer(&bp,&bpos,&size,0,4); // unknown
-    bit_writer(&bp,&bpos,&size,1,1); // hassize
-    bit_writer(&bp,&bpos,&size,0,2); // unused
-    bit_writer(&bp,&bpos,&size,1,1); // is-not-compressed
+    bit_writer(&bp,&bpos,&size,1,3); /* channel=1, stereo */
+    bit_writer(&bp,&bpos,&size,0,4); /* unknown */
+    bit_writer(&bp,&bpos,&size,0,8); /* unknown */
+    bit_writer(&bp,&bpos,&size,0,4); /* unknown */
+    bit_writer(&bp,&bpos,&size,1,1); /* hassize */
+    bit_writer(&bp,&bpos,&size,0,2); /* unused */
+    bit_writer(&bp,&bpos,&size,1,1); /* is-not-compressed */
 
     /* size of data, integer, big endian */
     bit_writer(&bp,&bpos,&size,(bsize>>24)&0xff,8);




More information about the pulseaudio-commits mailing list