summaryrefslogtreecommitdiff
path: root/encoders
diff options
context:
space:
mode:
Diffstat (limited to 'encoders')
-rw-r--r--encoders/vorbis_encoder.cpp6
-rw-r--r--encoders/vorbis_encoder.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/encoders/vorbis_encoder.cpp b/encoders/vorbis_encoder.cpp
index e00e31f..dc8f34a 100644
--- a/encoders/vorbis_encoder.cpp
+++ b/encoders/vorbis_encoder.cpp
@@ -49,11 +49,11 @@ std::size_t VorbisEncoder::write_pages(char *buf, std::size_t buf_size) {
}
/** Read from source and write pages.
- * Decodes a number of samples read from \c source,
+ * Encodes a number of samples read from \c source,
* then calls \c write_pages to write completed pages.
* \return Number of bytes written by \c write_pages.
*/
-std::size_t VorbisEncoder::decode(char *buf, std::size_t buf_size) {
+std::size_t VorbisEncoder::encode(char *buf, std::size_t buf_size) {
const int samples_n = 1024;
// samples_n samples, 2 channels, 2 byte per sample
@@ -108,7 +108,7 @@ std::size_t VorbisEncoder::read(char* buf, std::size_t buf_size) {
// run until we have a page or reached end of stream
while(written == 0 && !ogg_page_eos(&og)) {
- written += decode(buf+written, buf_size-written);
+ written += encode(buf+written, buf_size-written);
}
return written;
diff --git a/encoders/vorbis_encoder.h b/encoders/vorbis_encoder.h
index c3e3728..cba8c21 100644
--- a/encoders/vorbis_encoder.h
+++ b/encoders/vorbis_encoder.h
@@ -19,7 +19,7 @@ class VorbisEncoder : public Encoder {
protected:
std::size_t write_pages(char *buf, std::size_t buf_size);
- std::size_t decode(char *buf, std::size_t buf_size);
+ std::size_t encode(char *buf, std::size_t buf_size);
public:
VorbisEncoder(RawAudioSource::p source_);