diff options
author | Max Kellermann <max@duempel.org> | 2011-07-20 21:46:05 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2011-07-20 21:46:05 +0200 |
commit | 0ea4c970d794d535ae6efb4d0ae2d3fe37980ae3 (patch) | |
tree | d08d18c852febad9d6da94dfbe31545dcf93b5d0 /src/encoder/vorbis_encoder.c | |
parent | 57936a13741c09fa54a33a53ed05ac0d996e4807 (diff) | |
parent | 838f7cd210dbd3f071d48d54c168c123c3d20c58 (diff) | |
download | mpd-0ea4c970d794d535ae6efb4d0ae2d3fe37980ae3.tar.gz mpd-0ea4c970d794d535ae6efb4d0ae2d3fe37980ae3.tar.xz mpd-0ea4c970d794d535ae6efb4d0ae2d3fe37980ae3.zip |
Merge branch 'v0.16.x'
Conflicts:
src/player_thread.c
src/playlist_control.c
Diffstat (limited to 'src/encoder/vorbis_encoder.c')
-rw-r--r-- | src/encoder/vorbis_encoder.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/encoder/vorbis_encoder.c b/src/encoder/vorbis_encoder.c index 5b3110988..3e9d486b6 100644 --- a/src/encoder/vorbis_encoder.c +++ b/src/encoder/vorbis_encoder.c @@ -266,6 +266,15 @@ vorbis_encoder_flush(struct encoder *_encoder, G_GNUC_UNUSED GError **error) { struct vorbis_encoder *encoder = (struct vorbis_encoder *)_encoder; + encoder->flush = true; + return true; +} + +static bool +vorbis_encoder_pre_tag(struct encoder *_encoder, G_GNUC_UNUSED GError **error) +{ + struct vorbis_encoder *encoder = (struct vorbis_encoder *)_encoder; + vorbis_analysis_wrote(&encoder->vd, 0); vorbis_encoder_blockout(encoder); @@ -366,6 +375,7 @@ vorbis_encoder_read(struct encoder *_encoder, void *_dest, size_t length) if (ret == 0 && encoder->flush) { encoder->flush = false; ret = ogg_stream_flush(&encoder->os, &page); + } if (ret == 0) @@ -398,6 +408,7 @@ const struct encoder_plugin vorbis_encoder_plugin = { .open = vorbis_encoder_open, .close = vorbis_encoder_close, .flush = vorbis_encoder_flush, + .pre_tag = vorbis_encoder_pre_tag, .tag = vorbis_encoder_tag, .write = vorbis_encoder_write, .read = vorbis_encoder_read, |