diff options
| author | Colin Guthrie <pulse@colin.guthr.ie> | 2008-05-11 15:34:37 +0000 | 
|---|---|---|
| committer | Colin Guthrie <pulse@colin.guthr.ie> | 2008-10-08 20:32:08 +0100 | 
| commit | cb8c5a925fc22819626cbe4525b1d334db75d071 (patch) | |
| tree | 3f21a1092639fcb281236bc92b47f5b4794008f7 /src | |
| parent | 4b7b7b15d73a5f2a98229b12406b4397563d2983 (diff) | |
Some misc fixes. consts, base64 optimisation (not that it will be with us long anyway), and c comments
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2407 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src')
| -rw-r--r-- | src/modules/rtp/base64.c | 12 | ||||
| -rw-r--r-- | src/modules/rtp/headerlist.c | 2 | ||||
| -rw-r--r-- | src/modules/rtp/raop_client.c | 14 | 
3 files changed, 14 insertions, 14 deletions
diff --git a/src/modules/rtp/base64.c b/src/modules/rtp/base64.c index 043ef5a8..980b018e 100644 --- a/src/modules/rtp/base64.c +++ b/src/modules/rtp/base64.c @@ -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) diff --git a/src/modules/rtp/headerlist.c b/src/modules/rtp/headerlist.c index 8bdc7251..de8710b7 100644 --- a/src/modules/rtp/headerlist.c +++ b/src/modules/rtp/headerlist.c @@ -102,7 +102,7 @@ int pa_headerlist_putsappend(pa_headerlist *p, const char *key, const char *valu          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;      } diff --git a/src/modules/rtp/raop_client.c b/src/modules/rtp/raop_client.c index 15810170..fc42340c 100644 --- a/src/modules/rtp/raop_client.c +++ b/src/modules/rtp/raop_client.c @@ -461,13 +461,13 @@ int pa_raop_client_encode_sample(pa_raop_client* c, pa_memchunk* raw, pa_memchun      /* 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);  | 
