Skip to content
Snippets Groups Projects
Commit 59093c09 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Added calls to query the bit-stream version.

parent b9da9e45
No related branches found
No related tags found
No related merge requests found
......@@ -63,6 +63,9 @@ extern "C" {
/** GET the number of channels used in the current mode */
#define CELT_GET_NB_CHANNELS 1002
/** GET the bit-stream version for compatibility check */
#define CELT_GET_BITSTREAM_VERSION 2000
/** Contains the state of an encoder. One encoder state is needed for each
stream. It is initialised once at the beginning of the stream. Do *not*
......
......@@ -67,7 +67,7 @@ void EXPORT celt_header_init(CELTHeader *header, const CELTMode *m)
CELT_COPY(header->codec_id, "CELT ", 8);
CELT_COPY(header->codec_version, "experimental ", 20);
header->version_id = 0x80000001;
celt_mode_info(m, CELT_GET_BITSTREAM_VERSION, &header->version_id);
header->header_size = 56;
header->sample_rate = m->Fs;
header->nb_channels = m->nbChannels;
......
......@@ -65,6 +65,9 @@ int EXPORT celt_mode_info(const CELTMode *mode, int request, celt_int32_t *value
case CELT_GET_NB_CHANNELS:
*value = mode->nbChannels;
break;
case CELT_GET_BITSTREAM_VERSION:
*value = CELT_BITSTREAM_VERSION;
break;
default:
return CELT_BAD_ARG;
}
......
......@@ -39,6 +39,8 @@
#include "psy.h"
#include "pitch.h"
#define CELT_BITSTREAM_VERSION 0x80000002
#ifdef STATIC_MODES
#include "static_modes.h"
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment