diff options
author | Jean-Marc Valin <jean-marc.valin@usherbrooke.ca> | 2008-02-21 15:59:17 +0300 |
---|---|---|
committer | Jean-Marc Valin <jean-marc.valin@usherbrooke.ca> | 2008-02-21 15:59:17 +0300 |
commit | 14f5e7cd09ca4728d394ddc78bdc03abb55ba06e (patch) | |
tree | 6db22ed0823284db0da4d377e095e1401deee165 /tools/celtenc.c | |
parent | d501f6143caa7adf6a2782a086f195016d9cf588 (diff) |
Updated the header and celtenc/celtdec tools to the new way modes are handled.
Diffstat (limited to 'tools/celtenc.c')
-rw-r--r-- | tools/celtenc.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/tools/celtenc.c b/tools/celtenc.c index 15898aa..9b7240b 100644 --- a/tools/celtenc.c +++ b/tools/celtenc.c @@ -241,7 +241,7 @@ int main(int argc, char **argv) celt_int32_t frame_size; int quiet=0; int nbBytes; - const CELTMode *mode=celt_mono; + CELTMode *mode; void *st; unsigned char bits[MAX_FRAME_BYTES]; int with_skeleton = 0; @@ -432,7 +432,6 @@ int main(int argc, char **argv) if (chan == 1) { - mode = celt_mono; if (bitrate < 0) bitrate = 64; if (bitrate < 40) @@ -442,7 +441,6 @@ int main(int argc, char **argv) } else if (chan == 2) { - mode = celt_stereo; if (bitrate < 0) bitrate = 128; if (bitrate < 64) @@ -453,17 +451,16 @@ int main(int argc, char **argv) fprintf (stderr, "Only mono and stereo are supported\n"); return 1; } + mode = celt_mode_create(rate, chan, 256, 128, NULL); + if (!mode) + return 1; celt_mode_info(mode, CELT_GET_FRAME_SIZE, &frame_size); bytes_per_packet = (bitrate*1000*frame_size/rate+4)/8; - celt_header_init(&header, rate, 1, mode); + celt_header_init(&header, mode); header.nb_channels = chan; - if (chan == 1) - header.mode = 0; - else if (chan == 2) - header.mode = 1; - + { char *st_string="mono"; if (chan==2) @@ -663,6 +660,7 @@ int main(int argc, char **argv) } celt_encoder_destroy(st); + celt_mode_destroy(mode); ogg_stream_clear(&os); if (close_in) |