X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=opus_common.c;h=f4e18df915d657e43e9f9e583313ef962471a62a;hp=927df1f3c2f881fb036b13df50fbd49b43ec568d;hb=4643fd6eeee81acc0e82e47e7895a3111775bbba;hpb=7007aedb78262af262e7e7db8d010c6498e79290 diff --git a/opus_common.c b/opus_common.c index 927df1f3..f4e18df9 100644 --- a/opus_common.c +++ b/opus_common.c @@ -29,8 +29,6 @@ * handler. */ -#include - #include "para.h" #include "error.h" #include "opus_common.h" @@ -53,7 +51,7 @@ static int read_chars(struct packet *p, unsigned char *str, int nb_chars) return 1; } -static int read_uint32(struct packet *p, ogg_uint32_t *val) +static int read_uint32(struct packet *p, uint32_t *val) { if (p->pos > p->maxlen - 4) return 0; @@ -62,7 +60,7 @@ static int read_uint32(struct packet *p, ogg_uint32_t *val) return 1; } -static int read_uint16(struct packet *p, ogg_uint16_t *val) +static int read_uint16(struct packet *p, uint16_t *val) { if (p->pos > p->maxlen - 2) return 0; @@ -89,7 +87,6 @@ int opus_parse_header(const char *packet, int len, struct opus_header *h) char str[9]; struct packet p; unsigned char ch, channel_mapping; - ogg_uint16_t shortval; p.data = packet; p.maxlen = len; @@ -104,7 +101,7 @@ int opus_parse_header(const char *packet, int len, struct opus_header *h) if (!read_chars(&p, &ch, 1)) return -E_OPUS_HEADER; h->version = ch; - if((h->version & 240) != 0) /* Only major version 0 supported. */ + if ((h->version & 240) != 0) /* Only major version 0 supported. */ return -E_OPUS_HEADER; if (!read_chars(&p, &ch, 1)) @@ -113,16 +110,14 @@ int opus_parse_header(const char *packet, int len, struct opus_header *h) if (h->channels == 0) return -E_OPUS_HEADER; - if (!read_uint16(&p, &shortval)) + if (!read_uint16(&p, &h->preskip)) return -E_OPUS_HEADER; - h->preskip = shortval; if (!read_uint32(&p, &h->input_sample_rate)) return -E_OPUS_HEADER; - if (!read_uint16(&p, &shortval)) + if (!read_uint16(&p, &h->gain)) return -E_OPUS_HEADER; - h->gain = (short)shortval; if (!read_chars(&p, &ch, 1)) return -E_OPUS_HEADER;