From ad8117e7c8dc0b8a4c1f6b252c881ba5f5d2ebef Mon Sep 17 00:00:00 2001 From: Simon Arlott Date: Thu, 20 Apr 2023 21:22:52 +0100 Subject: [PATCH] decoder/openmpt: Fix build error with libopenmpt < 0.5 openmpt_at_end is a string, not an integer Fixes build error: src/decoder/plugins/OpenmptDecoderPlugin.cxx: In function 'void mod_decode(DecoderClient&, InputStream&)': src/decoder/plugins/OpenmptDecoderPlugin.cxx:85:44: error: invalid cast from type 'std::string_view' {aka 'std::basic_string_view'} to type 'unsigned in ' 85 | mod.ctl_set("play.at_end", std::to_string((unsigned)openmpt_at_end)); | ^~~~~~~~~~~~~~~~~~~~~~~~ --- src/decoder/plugins/OpenmptDecoderPlugin.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/decoder/plugins/OpenmptDecoderPlugin.cxx b/src/decoder/plugins/OpenmptDecoderPlugin.cxx index d14a3e477..0b3d3eca4 100644 --- a/src/decoder/plugins/OpenmptDecoderPlugin.cxx +++ b/src/decoder/plugins/OpenmptDecoderPlugin.cxx @@ -82,7 +82,7 @@ mod_decode(DecoderClient &client, InputStream &is) #else mod.ctl_set("seek.sync_samples", std::to_string((unsigned)openmpt_sync_samples)); mod.ctl_set("render.resampler.emulate_amiga", std::to_string((unsigned)openmpt_emulate_amiga)); - mod.ctl_set("play.at_end", std::to_string((unsigned)openmpt_at_end)); + mod.ctl_set("play.at_end", std::string{openmpt_at_end}); #endif static constexpr unsigned channels = 2;