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<char>'} to type 'unsigned in '
   85 |  mod.ctl_set("play.at_end", std::to_string((unsigned)openmpt_at_end));
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
Simon Arlott 2023-04-20 21:22:52 +01:00 committed by Max Kellermann
parent 82568c0b52
commit ad8117e7c8

View File

@ -82,7 +82,7 @@ mod_decode(DecoderClient &client, InputStream &is)
#else #else
mod.ctl_set("seek.sync_samples", std::to_string((unsigned)openmpt_sync_samples)); 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("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 #endif
static constexpr unsigned channels = 2; static constexpr unsigned channels = 2;