Adds OPUS_GET_LOOKAHEAD
authorJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Wed, 3 Aug 2011 16:44:37 +0000 (12:44 -0400)
committerJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Wed, 3 Aug 2011 16:44:37 +0000 (12:44 -0400)
src/opus.h
src/opus_encoder.c

index 2d2fdff..2f51fb7 100644 (file)
@@ -145,6 +145,9 @@ extern "C" {
 #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;
 
index 9f83148..b348d5e 100644 (file)
@@ -810,6 +810,12 @@ int opus_encoder_ctl(OpusEncoder *st, int request, ...)
             *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;