shithub: opus

Download patch

ref: 59093c090ec7ee3328d389549c6614e5c7a47017
parent: b9da9e45fdc699bd850522a6c68b839acf60b304
author: Jean-Marc Valin <[email protected]>
date: Thu May 15 17:53:27 EDT 2008

Added calls to query the bit-stream version.

--- a/libcelt/celt.h
+++ b/libcelt/celt.h
@@ -63,6 +63,9 @@
 /** 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*
--- a/libcelt/header.c
+++ b/libcelt/header.c
@@ -67,7 +67,7 @@
    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;
--- a/libcelt/modes.c
+++ b/libcelt/modes.c
@@ -65,6 +65,9 @@
       case CELT_GET_NB_CHANNELS:
          *value = mode->nbChannels;
          break;
+      case CELT_GET_BITSTREAM_VERSION:
+         *value = CELT_BITSTREAM_VERSION;
+         break;
       default:
          return CELT_BAD_ARG;
    }
--- a/libcelt/modes.h
+++ b/libcelt/modes.h
@@ -39,6 +39,8 @@
 #include "psy.h"
 #include "pitch.h"
 
+#define CELT_BITSTREAM_VERSION 0x80000002
+
 #ifdef STATIC_MODES
 #include "static_modes.h"
 #endif