From 0ff81a02b71ccdfa2a5a2f0ee59ed07eb36476b1 Mon Sep 17 00:00:00 2001 From: Luo Jinghua Date: Mon, 19 Dec 2011 10:23:10 +0800 Subject: Added tremor support --- src/input_ogg.cpp | 10 ++++++++++ src/input_ogg.h | 4 ++++ 2 files changed, 14 insertions(+) (limited to 'src') diff --git a/src/input_ogg.cpp b/src/input_ogg.cpp index 5873fe6..fb5535e 100644 --- a/src/input_ogg.cpp +++ b/src/input_ogg.cpp @@ -53,6 +53,14 @@ namespace audiere { return false; } +#ifdef ENABLE_TREMOR + if (vi->channels != 1 && vi->channels != 2) { + ov_clear(&m_vorbis_file); + m_file = 0; + return false; + } +#endif + // read metadata vorbis_comment* comments = ov_comment(&m_vorbis_file, -1); if (comments) { @@ -120,9 +128,11 @@ namespace audiere { &m_vorbis_file, (char*)out, samples_left * sample_size, +#ifndef ENABLE_TREMOR ENDIANNESS, 2, // 16-bit 1, // signed +#endif &bitstream); if (result < 0) { diff --git a/src/input_ogg.h b/src/input_ogg.h index 3a867ef..5bb0912 100644 --- a/src/input_ogg.h +++ b/src/input_ogg.h @@ -2,7 +2,11 @@ #define INPUT_OGG_H +#ifdef ENABLE_TREMOR +#include +#else #include +#endif #include "audiere.h" #include "basic_source.h" -- cgit v1.2.3