mixer.c: Fix doxygen \file description.
[paraslash.git] / opus_common.c
index 67a8841e8b8ce7fe172043a144332cb1db4c577f..f4e18df915d657e43e9f9e583313ef962471a62a 100644 (file)
@@ -29,8 +29,6 @@
  * handler.
  */
 
-#include <ogg/ogg.h>
-
 #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;
@@ -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;