ref: d9458cd0b3bd65bb4daaf29761ea74a60f496bd6
parent: e4c05a4d744a3d9600dcb87d7102b279ba1292a4
author: Gregory Maxwell <[email protected]>
date: Sat May 30 13:04:02 EDT 2009
Add a mode_info call to obtain the sampling rate of the current mode.
--- a/libcelt/celt.h
+++ b/libcelt/celt.h
@@ -87,6 +87,8 @@
#define CELT_GET_LOOKAHEAD 1001
/** GET the number of channels used in the current mode */
#define CELT_GET_NB_CHANNELS 1002
+/** GET the sample rate used in the current mode */
+#define CELT_GET_SAMPLE_RATE 1003
/** GET the bit-stream version for compatibility check */
#define CELT_GET_BITSTREAM_VERSION 2000
--- a/libcelt/modes.c
+++ b/libcelt/modes.c
@@ -68,6 +68,9 @@
case CELT_GET_BITSTREAM_VERSION:
*value = CELT_BITSTREAM_VERSION;
break;
+ case CELT_GET_SAMPLE_RATE:
+ *value = mode->Fs;
+ break;
default:
return CELT_UNIMPLEMENTED;
}