Commit bdd02802 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

setting nb channels automatically from the mode.

parent 0d28aa99
......@@ -296,11 +296,14 @@ static CELTDecoder *process_header(ogg_packet *op, celt_int32_t enh_enabled, cel
celt_header_from_packet((char*)op->packet, op->bytes, &header);
if (header.mode==0)
{
mode = celt_mono;
else if (header.mode==1)
mode = celt_stereo;
else
*channels = 1;
} else if (header.mode==1)
{
mode = celt_stereo;
*channels = 2;
} else {
fprintf (stderr, "Invalid mode: %d\n", header.mode);
return NULL;
}
......@@ -321,9 +324,6 @@ static CELTDecoder *process_header(ogg_packet *op, celt_int32_t enh_enabled, cel
*nframes = 1;
if (*channels==-1)
*channels = header.nb_channels;
if (!quiet)
{
fprintf (stderr, "Decoding %d Hz audio in", *rate);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment