aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-03-16 19:13:46 +0100
committerMax Kellermann <max@duempel.org>2011-03-16 19:16:06 +0100
commitb6303313f0145c4caf58195ba4a85d2f4fa2967c (patch)
tree352ba4ea4bd48c95b71692a53923c7acc4968c1b
parent6dcec366214da4238819914985e4921e258ba324 (diff)
downloadmpd-b6303313f0145c4caf58195ba4a85d2f4fa2967c.tar.gz
mpd-b6303313f0145c4caf58195ba4a85d2f4fa2967c.tar.xz
mpd-b6303313f0145c4caf58195ba4a85d2f4fa2967c.zip
encoder/vorbis: reset the Ogg stream after flush
Without the ogg_stream_reset() call, the "e_o_s" flag never gets reset, and libogg writes EOS packets over and over.
-rw-r--r--NEWS2
-rw-r--r--src/encoder/vorbis_encoder.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 5f7ef436c..1dfd71107 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,8 @@ ver 0.16.2 (2011/??/??)
* decoder:
- tremor: fix configure test
- gme: detect end of song
+* encoder:
+ - vorbis: reset the Ogg stream after flush
* output:
- httpd: fix uninitialized variable
- httpd: include sys/socket.h
diff --git a/src/encoder/vorbis_encoder.c b/src/encoder/vorbis_encoder.c
index 9dac3564d..08147be1c 100644
--- a/src/encoder/vorbis_encoder.c
+++ b/src/encoder/vorbis_encoder.c
@@ -276,6 +276,8 @@ vorbis_encoder_flush(struct encoder *_encoder, G_GNUC_UNUSED GError **error)
vorbis_analysis_init(&encoder->vd, &encoder->vi);
vorbis_block_init(&encoder->vd, &encoder->vb);
+ ogg_stream_reset(&encoder->os);
+
encoder->flush = true;
return true;
}