From 7c59d819a7ebb936d51ca032e66a2489e4080d08 Mon Sep 17 00:00:00 2001 From: George Marques Date: Sun, 1 May 2016 12:48:46 -0300 Subject: Update Opus driver to 1.1.2 And opusfile to 0.7. --- drivers/opus/opus.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'drivers/opus/opus.c') diff --git a/drivers/opus/opus.c b/drivers/opus/opus.c index 5af71b478d..762a9d7469 100644 --- a/drivers/opus/opus.c +++ b/drivers/opus/opus.c @@ -24,10 +24,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#ifdef OPUS_ENABLED #include "opus/opus_config.h" -#endif #include "opus/opus.h" #include "opus/opus_private.h" @@ -166,6 +163,27 @@ static int parse_size(const unsigned char *data, opus_int32 len, opus_int16 *siz } } +int opus_packet_get_samples_per_frame(const unsigned char *data, + opus_int32 Fs) +{ + int audiosize; + if (data[0]&0x80) + { + audiosize = ((data[0]>>3)&0x3); + audiosize = (Fs<>3)&0x3); + if (audiosize == 3) + audiosize = Fs*60/1000; + else + audiosize = (Fs<