shithub: libopusenc

Download patch

ref: 59908bea22cdcfbedb8beb28fe0acddd887fca57
parent: b34ebdf157b60e41f2cd997d62973df1829c81c2
author: Jean-Marc Valin <jmvalin@jmvalin.ca>
date: Thu Jul 26 16:11:52 EDT 2018

Use ambisonics families 2 and 3 instead of 254 and 253

--- a/src/opus_header.c
+++ b/src/opus_header.c
@@ -41,7 +41,8 @@
   - Sampling rate (32 bits)
   - Gain in dB (16 bits, S7.8)
   - Mapping (8 bits, 0=single stream (mono/stereo) 1=Vorbis mapping,
-             2..254: reserved, 255: multistream with no mapping)
+             2=ambisonics, 3=projection ambisonics, 4..239: reserved,
+             240..254: experiments, 255: multistream with no mapping)
 
   - if (mapping != 0)
      - N = total number of streams (8 bits)
--- a/src/opusenc.c
+++ b/src/opusenc.c
@@ -178,7 +178,7 @@
 };
 
 int opeint_use_projection(int channel_mapping) {
-  if (channel_mapping==253){
+  if (channel_mapping==3){
     return 1;
   }
   return 0;
@@ -368,7 +368,7 @@
   int ret;
   if (family != 0 && family != 1 &&
 #ifdef OPUS_HAVE_OPUS_PROJECTION_H
-      family != 253 && family != 254 &&
+      family != 2 && family != 3 &&
 #endif
       family != 255 && family != -1) {
     if (error) {
@@ -476,7 +476,7 @@
   if (family < 0 || family > 255) return OPE_BAD_ARG;
   else if (family != 1 &&
   #ifdef OPUS_HAVE_OPUS_PROJECTION_H
-      family != 254 &&
+      family != 2 &&
   #endif
       family != 255) return OPE_UNIMPLEMENTED;
   else if (streams <= 0 || streams>255 || coupled_streams<0 || coupled_streams >= 128 || streams+coupled_streams > 255) return OPE_BAD_ARG;