diff options
author | Luo Jinghua <sunmoon1997@gmail.com> | 2011-12-19 10:23:10 +0800 |
---|---|---|
committer | Luo Jinghua <sunmoon1997@gmail.com> | 2011-12-19 10:23:10 +0800 |
commit | 0ff81a02b71ccdfa2a5a2f0ee59ed07eb36476b1 (patch) | |
tree | 9216a8a38fef4fe5bb231cb2a6ceb478a731e27e /src | |
parent | b48c05fd9b6a3f8fc5333499251e4d526e5c4faa (diff) |
Added tremor support
Diffstat (limited to 'src')
-rw-r--r-- | src/input_ogg.cpp | 10 | ||||
-rw-r--r-- | src/input_ogg.h | 4 |
2 files changed, 14 insertions, 0 deletions
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 <tremor/ivorbisfile.h> +#else #include <vorbis/vorbisfile.h> +#endif #include "audiere.h" #include "basic_source.h" |