shithub: opus

Download patch

ref: 9d8b51969987fa5e4c5fa58f3e7d3bfb76bf6b1c
parent: 63fd63d6659edaedb89d72557f7c8dea2c44c355
author: Jean-Marc Valin <[email protected]>
date: Wed Aug 3 08:44:37 EDT 2011

Adds OPUS_GET_LOOKAHEAD

--- a/src/opus.h
+++ b/src/opus.h
@@ -145,6 +145,9 @@
 #define OPUS_GET_SIGNAL_REQUEST 25
 #define OPUS_GET_SIGNAL(x) OPUS_GET_SIGNAL_REQUEST, __check_int_ptr(x)
 
+#define OPUS_GET_LOOKAHEAD_REQUEST 27
+#define OPUS_GET_LOOKAHEAD(x) OPUS_GET_LOOKAHEAD_REQUEST, __check_int_ptr(x)
+
 typedef struct OpusEncoder OpusEncoder;
 typedef struct OpusDecoder OpusDecoder;
 
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -810,6 +810,12 @@
             *value = st->signal_type;
         }
         break;
+        case OPUS_GET_LOOKAHEAD_REQUEST:
+        {
+            int *value = va_arg(ap, int*);
+            *value = st->delay_compensation+st->Fs/400;
+        }
+        break;
         default:
             fprintf(stderr, "unknown opus_encoder_ctl() request: %d", request);
             break;