diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2011-03-02 22:35:20 +0100 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2011-03-02 22:35:20 +0100 |
commit | 7167b1c4ce914facaa14cd6db8cf7219b622da97 (patch) | |
tree | abc81a74ec51f953b5eec25a086a82287609ddbe /encoders | |
parent | 0c2f90ee5c713fcb3aedb236fcebe7dd6d323ba3 (diff) | |
parent | 6e7b8f94bf7fdc087cd1eed604eabed6070dffad (diff) |
Merge branch 'master' into cache_range
Conflicts:
music.cpp
Diffstat (limited to 'encoders')
-rw-r--r-- | encoders/lame_encoder.cpp | 14 | ||||
-rw-r--r-- | encoders/lame_encoder.h | 3 |
2 files changed, 3 insertions, 14 deletions
diff --git a/encoders/lame_encoder.cpp b/encoders/lame_encoder.cpp index 6616b87..f3816bf 100644 --- a/encoders/lame_encoder.cpp +++ b/encoders/lame_encoder.cpp @@ -15,24 +15,16 @@ EncoderLame::~EncoderLame() { lame_close(gfp); } -size_t EncoderLame::encode(const uint8_t *input, size_t input_size, uint8_t *output, size_t output_size) { - return lame_encode_buffer_interleaved(gfp, (short*)input, input_size / 4, output, output_size); -} - -size_t EncoderLame::flush(uint8_t *output, size_t output_size) { - return lame_encode_flush(gfp, output, output_size); -} - std::size_t EncoderLame::read(char* buf, std::size_t buf_size) { char src_data[0x30000]; std::streamsize src_read = source->read(src_data, 0x30000); if(src_read < 0) src_read = 0; - std::streamsize size = encode((const uint8_t*)src_data, src_read, (uint8_t*)buf, buf_size); + std::size_t size = lame_encode_buffer_interleaved(gfp, (short*)src_data, src_read / 4, (unsigned char*)buf, buf_size); // no more data, flush encoder if(src_read == 0 && size == 0) { - size = flush((uint8_t*)buf, buf_size); + size = lame_encode_flush(gfp, (unsigned char*)buf, buf_size); } return size; -}
\ No newline at end of file +} diff --git a/encoders/lame_encoder.h b/encoders/lame_encoder.h index d150f60..79bc944 100644 --- a/encoders/lame_encoder.h +++ b/encoders/lame_encoder.h @@ -11,9 +11,6 @@ class EncoderLame : public Encoder { private: lame_global_flags *gfp; RawAudioSource::p source; - - size_t encode(const uint8_t *input, size_t input_size, uint8_t *output, size_t output_size); - size_t flush(uint8_t *output, size_t output_size); public: EncoderLame(RawAudioSource::p source_); |