From 731f20111a2d4038c46046ec787f63018c143c78 Mon Sep 17 00:00:00 2001 From: boedy Date: Thu, 8 Aug 2024 18:42:41 +0200 Subject: [PATCH] Override the value for file size in bytes. Useful for getting sensible track length values in feed mode or for HTTP streams. https://www.mpg123.de/api/group__mpg123__status.shtml#gad0301e80dbc3f48e47e27d39cd328755 --- src/decoder/plugins/Mpg123DecoderPlugin.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/decoder/plugins/Mpg123DecoderPlugin.cxx b/src/decoder/plugins/Mpg123DecoderPlugin.cxx index 3ae5e86f8..c0ad31a81 100644 --- a/src/decoder/plugins/Mpg123DecoderPlugin.cxx +++ b/src/decoder/plugins/Mpg123DecoderPlugin.cxx @@ -353,6 +353,10 @@ mpd_mpg123_stream_decode(DecoderClient &client, InputStream &is) }; mpd_mpg123_open_stream(*handle, iohandle); + + if (is.KnownSize()) + mpg123_set_filesize(handle, is.GetSize()); + Decode(client, *handle, is.IsSeekable()); }