summaryrefslogtreecommitdiff
path: root/encoders
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-01-02 22:17:26 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2011-01-02 22:17:40 +0100
commit237c3e226b7c2ac391b0e8d354e5fc6f587a41ba (patch)
treee1f0c89792e2baccb1d1ed21b913445d6e330715 /encoders
parentb72175dab679c14be80b6e5db7129f8d3b518079 (diff)
Use a filtering_istream with custom filters to chain file -> decoder -> encoder.
Diffstat (limited to 'encoders')
-rw-r--r--encoders/lame_encoder.cpp8
-rw-r--r--encoders/lame_encoder.h2
2 files changed, 4 insertions, 6 deletions
diff --git a/encoders/lame_encoder.cpp b/encoders/lame_encoder.cpp
index 4cbfc9c..125ee5e 100644
--- a/encoders/lame_encoder.cpp
+++ b/encoders/lame_encoder.cpp
@@ -15,12 +15,10 @@ EncoderLame::~EncoderLame() {
lame_close(gfp);
}
-size_t EncoderLame::encode(uint8_t *input, size_t input_size, uint8_t *output, size_t output_size) {
- size_t size = lame_encode_buffer_interleaved(gfp, (short*)input, input_size / 4, output, output_size);
- return size;
+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) {
- size_t size = lame_encode_flush(gfp, output, output_size);
- return size;
+ return lame_encode_flush(gfp, output, output_size);
}
diff --git a/encoders/lame_encoder.h b/encoders/lame_encoder.h
index 47f9666..1843361 100644
--- a/encoders/lame_encoder.h
+++ b/encoders/lame_encoder.h
@@ -12,7 +12,7 @@ class EncoderLame : public EncoderBase {
public:
EncoderLame();
~EncoderLame();
- size_t encode(uint8_t *input, size_t input_size, uint8_t *output, size_t output_size);
+ 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);
};