From d9458cd0b3bd65bb4daaf29761ea74a60f496bd6 Mon Sep 17 00:00:00 2001 From: Gregory Maxwell Date: Sat, 30 May 2009 17:04:02 -0400 Subject: [PATCH] Add a mode_info call to obtain the sampling rate of the current mode. --- libcelt/celt.h | 2 ++ libcelt/modes.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/libcelt/celt.h b/libcelt/celt.h index 6bf32b8e..aa403641 100644 --- a/libcelt/celt.h +++ b/libcelt/celt.h @@ -87,6 +87,8 @@ extern "C" { #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 diff --git a/libcelt/modes.c b/libcelt/modes.c index 7468a8e8..85f04704 100644 --- a/libcelt/modes.c +++ b/libcelt/modes.c @@ -68,6 +68,9 @@ int celt_mode_info(const CELTMode *mode, int request, celt_int32_t *value) case CELT_GET_BITSTREAM_VERSION: *value = CELT_BITSTREAM_VERSION; break; + case CELT_GET_SAMPLE_RATE: + *value = mode->Fs; + break; default: return CELT_UNIMPLEMENTED; }