From 6de088140b2fb3afe2905ad3ea2e2d0648eb603f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 12 Jul 2019 18:33:27 +0200 Subject: [PATCH] lib/xiph/OggVisitor: invoke OnOggPacket() with the "E_O_S" packet The "end of stream" packet is not special; it contains normal data, and thus we should pass it to OnOggPacket(). This fixes one part of https://github.com/MusicPlayerDaemon/MPD/issues/601 --- NEWS | 1 + src/lib/xiph/OggVisitor.cxx | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 69121ac7f..d67bbb26a 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ ver 0.21.12 (not yet released) * decoder - opus: ignore case in replay gain tag names + - opus, vorbis: decode the "end of stream" packet * Windows - support backslash in relative URIs loaded from playlists diff --git a/src/lib/xiph/OggVisitor.cxx b/src/lib/xiph/OggVisitor.cxx index b975d8d17..04a02469f 100644 --- a/src/lib/xiph/OggVisitor.cxx +++ b/src/lib/xiph/OggVisitor.cxx @@ -69,12 +69,12 @@ OggVisitor::HandlePacket(const ogg_packet &packet) /* fail if BOS is missing */ throw std::runtime_error("BOS packet expected"); + OnOggPacket(packet); + if (packet.e_o_s) { EndStream(); return; } - - OnOggPacket(packet); } inline void