summaryrefslogtreecommitdiff
path: root/encoders
diff options
context:
space:
mode:
Diffstat (limited to 'encoders')
-rw-r--r--encoders/lame_encoder.cpp14
-rw-r--r--encoders/lame_encoder.h3
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_);