Hello community, here is the log from the commit of package libopenmpt for openSUSE:Factory checked in at 2018-08-02 14:47:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libopenmpt (Old) and /work/SRC/openSUSE:Factory/.libopenmpt.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libopenmpt" Thu Aug 2 14:47:53 2018 rev:11 rq:625937 version:0.3.11 Changes: -------- --- /work/SRC/openSUSE:Factory/libopenmpt/libopenmpt.changes 2018-06-05 12:52:44.710003725 +0200 +++ /work/SRC/openSUSE:Factory/.libopenmpt.new/libopenmpt.changes 2018-08-02 14:48:10.479254661 +0200 @@ -1,0 +2,30 @@ +Sat Jul 28 13:36:32 UTC 2018 - [email protected] + +- Update to version 0.3.11: + * [Sec] Crash with some malformed custom tunings in MPTM files + * Channels whose volume envelope was playing at volume 0 while + being moved to a NNA background channel were cut off completely + since libopenmpt 0.3.8. + * AMF (ASYLUM): Convert 7-bit panning to 8-bit panning for + playback +- Update to version 0.3.10: + * [Bug] Internal mixer state was not initialized properly when + initially rendering in 44100kHz stereo format. + * [Bug] AMF: Undefined behaviour in loader code could lead to + files playing silent. + * Switching between instruments with portamento did not update + the NNA settings for the new instrument. + * FAR: Properly import volume commands. + * [Sec] Possible write near address 0 in out-of-memory situations + when reading AMS files. + * [Bug] openmpt123: Fixed build failure in C++17 due to use of + removed feature std::random_shuffle. + * STM: Having both Bxx and Cxx commands in a pattern imported the + Bxx command incorrectly. + * STM: Last character of sample name was missing. + * Speed up reading of truncated ULT files. + * ULT: Portamento import was sometimes broken. + * The resonant filter was sometimes unstable when combining + low-volume samples, low cutoff and high mixing rates. + +------------------------------------------------------------------- Old: ---- libopenmpt-0.3.9+release.autotools.tar.gz New: ---- libopenmpt-0.3.11+release.autotools.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libopenmpt.spec ++++++ --- /var/tmp/diff_new_pack.nMdKi6/_old 2018-08-02 14:48:11.319256268 +0200 +++ /var/tmp/diff_new_pack.nMdKi6/_new 2018-08-02 14:48:11.323256275 +0200 @@ -21,7 +21,7 @@ %define libopenmpt_modplug libopenmpt_modplug1 %bcond_without mpg123 Name: libopenmpt -Version: 0.3.9 +Version: 0.3.11 Release: 0 Summary: C++ and C library to decode tracker music files License: BSD-3-Clause ++++++ libopenmpt-0.3.9+release.autotools.tar.gz -> libopenmpt-0.3.11+release.autotools.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/common/CompilerDetect.h new/libopenmpt-0.3.11+release.autotools/common/CompilerDetect.h --- old/libopenmpt-0.3.9+release.autotools/common/CompilerDetect.h 2017-12-08 14:03:16.000000000 +0100 +++ new/libopenmpt-0.3.11+release.autotools/common/CompilerDetect.h 2018-04-29 10:32:32.000000000 +0200 @@ -61,7 +61,9 @@ #elif defined(_MSC_VER) #define MPT_COMPILER_MSVC 1 -#if (_MSC_VER >= 1912) +#if (_MSC_VER >= 1913) +#define MPT_COMPILER_MSVC_VERSION MPT_COMPILER_MAKE_VERSION2(2017,6) +#elif (_MSC_VER >= 1912) #define MPT_COMPILER_MSVC_VERSION MPT_COMPILER_MAKE_VERSION2(2017,5) #elif (_MSC_VER >= 1911) #define MPT_COMPILER_MSVC_VERSION MPT_COMPILER_MAKE_VERSION2(2017,3) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/common/Logging.cpp new/libopenmpt-0.3.11+release.autotools/common/Logging.cpp --- old/libopenmpt-0.3.9+release.autotools/common/Logging.cpp 2017-09-24 09:24:38.000000000 +0200 +++ new/libopenmpt-0.3.11+release.autotools/common/Logging.cpp 2018-05-01 13:00:10.000000000 +0200 @@ -255,6 +255,7 @@ static uint32 ThreadIdGUI = 0; static uint32 ThreadIdAudio = 0; static uint32 ThreadIdNotify = 0; +static uint32 ThreadIdWatchdir = 0; void Enable(std::size_t numEntries) { @@ -379,6 +380,9 @@ } else if(entry.ThreadId == ThreadIdNotify) { f << " --Notify "; + } else if(entry.ThreadId == ThreadIdWatchdir) + { + f << " WatchDir "; } else { f << " " << mpt::fmt::hex0<8>(entry.ThreadId) << " "; @@ -406,7 +410,31 @@ case ThreadKindNotify: ThreadIdNotify = id; break; + case ThreadKindWatchdir: + ThreadIdWatchdir = id; + break; + } +} + +uint32 GetThreadId(mpt::log::Trace::ThreadKind kind) +{ + uint32 result = 0; + switch(kind) + { + case ThreadKindGUI: + result = ThreadIdGUI; + break; + case ThreadKindAudio: + result = ThreadIdAudio; + break; + case ThreadKindNotify: + result = ThreadIdNotify; + break; + case ThreadKindWatchdir: + result = ThreadIdWatchdir; + break; } + return result; } #endif // MPT_OS_WINDOWS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/common/Logging.h new/libopenmpt-0.3.11+release.autotools/common/Logging.h --- old/libopenmpt-0.3.9+release.autotools/common/Logging.h 2016-09-04 09:32:45.000000000 +0200 +++ new/libopenmpt-0.3.11+release.autotools/common/Logging.h 2018-05-01 13:00:10.000000000 +0200 @@ -235,12 +235,14 @@ ThreadKindGUI, ThreadKindAudio, ThreadKindNotify, + ThreadKindWatchdir, }; void Enable(std::size_t numEntries); void Disable(); void SetThreadId(mpt::log::Trace::ThreadKind kind, uint32 id); +uint32 GetThreadId(mpt::log::Trace::ThreadKind kind); void Seal(); bool Dump(const mpt::PathString &filename); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/common/mptRandom.cpp new/libopenmpt-0.3.11+release.autotools/common/mptRandom.cpp --- old/libopenmpt-0.3.9+release.autotools/common/mptRandom.cpp 2017-04-27 09:27:15.000000000 +0200 +++ new/libopenmpt-0.3.11+release.autotools/common/mptRandom.cpp 2018-04-29 10:51:09.000000000 +0200 @@ -305,7 +305,7 @@ mpt::thread_safe_prng<mpt::best_prng> & global_prng() { - static mpt::thread_safe_prng<mpt::best_prng> g_best_prng(global_random_device()); + static mpt::thread_safe_prng<mpt::best_prng> g_best_prng(mpt::make_prng<mpt::best_prng>(global_random_device())); return g_best_prng; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/common/versionNumber.h new/libopenmpt-0.3.11+release.autotools/common/versionNumber.h --- old/libopenmpt-0.3.9+release.autotools/common/versionNumber.h 2018-04-29 08:03:48.000000000 +0200 +++ new/libopenmpt-0.3.11+release.autotools/common/versionNumber.h 2018-07-28 12:51:57.000000000 +0200 @@ -18,8 +18,8 @@ //Version definitions. The only thing that needs to be changed when changing version number. #define VER_MAJORMAJOR 1 #define VER_MAJOR 27 -#define VER_MINOR 07 -#define VER_MINORMINOR 02 +#define VER_MINOR 09 +#define VER_MINORMINOR 00 //Version string. For example "1.17.02.28" #define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR) "." VER_STRINGIZE(VER_MAJOR) "." VER_STRINGIZE(VER_MINOR) "." VER_STRINGIZE(VER_MINORMINOR) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/configure new/libopenmpt-0.3.11+release.autotools/configure --- old/libopenmpt-0.3.9+release.autotools/configure 2018-04-29 08:12:57.000000000 +0200 +++ new/libopenmpt-0.3.11+release.autotools/configure 2018-07-28 13:57:41.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libopenmpt 0.3.9+release.autotools. +# Generated by GNU Autoconf 2.69 for libopenmpt 0.3.11+release.autotools. # # Report bugs to <https://bugs.openmpt.org/>. # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='libopenmpt' PACKAGE_TARNAME='libopenmpt' -PACKAGE_VERSION='0.3.9+release.autotools' -PACKAGE_STRING='libopenmpt 0.3.9+release.autotools' +PACKAGE_VERSION='0.3.11+release.autotools' +PACKAGE_STRING='libopenmpt 0.3.11+release.autotools' PACKAGE_BUGREPORT='https://bugs.openmpt.org/' PACKAGE_URL='https://lib.openmpt.org/' @@ -1482,7 +1482,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libopenmpt 0.3.9+release.autotools to adapt to many kinds of systems. +\`configure' configures libopenmpt 0.3.11+release.autotools to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1553,7 +1553,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libopenmpt 0.3.9+release.autotools:";; + short | recursive ) echo "Configuration of libopenmpt 0.3.11+release.autotools:";; esac cat <<\_ACEOF @@ -1752,7 +1752,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libopenmpt configure 0.3.9+release.autotools +libopenmpt configure 0.3.11+release.autotools generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2151,7 +2151,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libopenmpt $as_me 0.3.9+release.autotools, which was +It was created by libopenmpt $as_me 0.3.11+release.autotools, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3022,7 +3022,7 @@ # Define the identity of the package. PACKAGE='libopenmpt' - VERSION='0.3.9+release.autotools' + VERSION='0.3.11+release.autotools' cat >>confdefs.h <<_ACEOF @@ -17186,13 +17186,13 @@ -$as_echo "#define MPT_SVNURL \"https://source.openmpt.org/svn/openmpt/tags/libopenmpt-0.3.9\"" >>confdefs.h +$as_echo "#define MPT_SVNURL \"https://source.openmpt.org/svn/openmpt/tags/libopenmpt-0.3.11\"" >>confdefs.h -$as_echo "#define MPT_SVNVERSION \"10169\"" >>confdefs.h +$as_echo "#define MPT_SVNVERSION \"10633\"" >>confdefs.h -$as_echo "#define MPT_SVNDATE \"2018-04-29T06:08:50.600539Z\"" >>confdefs.h +$as_echo "#define MPT_SVNDATE \"2018-07-28T11:50:00.062292Z\"" >>confdefs.h $as_echo "#define MPT_PACKAGE true" >>confdefs.h @@ -22366,7 +22366,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libopenmpt $as_me 0.3.9+release.autotools, which was +This file was extended by libopenmpt $as_me 0.3.11+release.autotools, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -22433,7 +22433,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libopenmpt config.status 0.3.9+release.autotools +libopenmpt config.status 0.3.11+release.autotools configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/configure.ac new/libopenmpt-0.3.11+release.autotools/configure.ac --- old/libopenmpt-0.3.9+release.autotools/configure.ac 2018-04-29 08:12:46.000000000 +0200 +++ new/libopenmpt-0.3.11+release.autotools/configure.ac 2018-07-28 13:57:30.000000000 +0200 @@ -1,4 +1,4 @@ -AC_INIT([libopenmpt], [0.3.9+release.autotools], [https://bugs.openmpt.org/], [libopenmpt], [https://lib.openmpt.org/]) +AC_INIT([libopenmpt], [0.3.11+release.autotools], [https://bugs.openmpt.org/], [libopenmpt], [https://lib.openmpt.org/]) AC_PREREQ([2.68]) AC_CONFIG_MACRO_DIR([m4]) @@ -27,9 +27,9 @@ AC_SUBST([LIBOPENMPT_LTVER_REVISION]) AC_SUBST([LIBOPENMPT_LTVER_AGE]) -AC_DEFINE([MPT_SVNURL], ["https://source.openmpt.org/svn/openmpt/tags/libopenmpt-0.3.9"], [svn version]) -AC_DEFINE([MPT_SVNVERSION], ["10169"], [svn version]) -AC_DEFINE([MPT_SVNDATE], ["2018-04-29T06:08:50.600539Z"], [svn date]) +AC_DEFINE([MPT_SVNURL], ["https://source.openmpt.org/svn/openmpt/tags/libopenmpt-0.3.11"], [svn version]) +AC_DEFINE([MPT_SVNVERSION], ["10633"], [svn version]) +AC_DEFINE([MPT_SVNDATE], ["2018-07-28T11:50:00.062292Z"], [svn date]) AC_DEFINE([MPT_PACKAGE], [true], [is package]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/libopenmpt/dox/changelog.md new/libopenmpt-0.3.11+release.autotools/libopenmpt/dox/changelog.md --- old/libopenmpt-0.3.9+release.autotools/libopenmpt/dox/changelog.md 2018-04-29 08:08:21.000000000 +0200 +++ new/libopenmpt-0.3.11+release.autotools/libopenmpt/dox/changelog.md 2018-07-28 13:48:29.000000000 +0200 @@ -5,6 +5,25 @@ For fully detailed change log, please see the source repository directly. This is just a high-level summary. +### libopenmpt 0.3.11 (2018-07-28) + + * [**Sec**] Crash with some malformed custom tunings in MPTM files (r10615). + + * Channels whose volume envelope was playing at volume 0 while being moved to + a NNA background channel were cut off completely since libopenmpt 0.3.8. + * AMF (ASYLUM): Convert 7-bit panning to 8-bit panning for playback. + +### libopenmpt 0.3.10 (2018-06-17) + + * [**Bug**] Internal mixer state was not initialized properly when initially + rendering in 44100kHz stereo format. + * [**Bug**] AMF: Undefined behaviour in loader code could lead to files + playing silent. + + * Switching between instruments with portamento did not update the NNA + settings for the new instrument. + * FAR: Properly import volume commands. + ### libopenmpt 0.3.9 (2018-04-29) * [**Sec**] Possible write near address 0 in out-of-memory situations when diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/libopenmpt/libopenmpt_c.cpp new/libopenmpt-0.3.11+release.autotools/libopenmpt/libopenmpt_c.cpp --- old/libopenmpt-0.3.9+release.autotools/libopenmpt/libopenmpt_c.cpp 2017-11-10 09:28:03.000000000 +0100 +++ new/libopenmpt-0.3.11+release.autotools/libopenmpt/libopenmpt_c.cpp 2018-07-05 14:24:48.000000000 +0200 @@ -66,7 +66,7 @@ class invalid_module_pointer : public openmpt::exception { public: - invalid_module_pointer() throw() + invalid_module_pointer() : openmpt::exception("module * not valid") { return; @@ -78,7 +78,7 @@ class argument_null_pointer : public openmpt::exception { public: - argument_null_pointer() throw() + argument_null_pointer() : openmpt::exception("argument null pointer") { return; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/libopenmpt/libopenmpt_impl.cpp new/libopenmpt-0.3.11+release.autotools/libopenmpt/libopenmpt_impl.cpp --- old/libopenmpt-0.3.9+release.autotools/libopenmpt/libopenmpt_impl.cpp 2017-12-15 17:58:58.000000000 +0100 +++ new/libopenmpt-0.3.11+release.autotools/libopenmpt/libopenmpt_impl.cpp 2018-05-30 17:14:01.000000000 +0200 @@ -415,11 +415,14 @@ mixersettings.SetVolumeRampUpMicroseconds( volrampin_us ); mixersettings.SetVolumeRampDownMicroseconds( volrampout_us ); m_sndFile->SetMixerSettings( mixersettings ); + } else if ( !m_mixer_initialized ) { + m_sndFile->InitPlayer( true ); } if ( samplerate_changed ) { m_sndFile->SuspendPlugins(); m_sndFile->ResumePlugins(); } + m_mixer_initialized = true; } void module_impl::apply_libopenmpt_defaults() { set_render_param( module::RENDER_STEREOSEPARATION_PERCENT, 100 ); @@ -447,6 +450,7 @@ void module_impl::ctor( const std::map< std::string, std::string > & ctls ) { m_sndFile = mpt::make_unique<CSoundFile>(); m_loaded = false; + m_mixer_initialized = false; m_Dither = mpt::make_unique<Dither>(mpt::global_prng()); m_LogForwarder = mpt::make_unique<log_forwarder>( *m_Log ); m_sndFile->SetCustomLog( m_LogForwarder.get() ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/libopenmpt/libopenmpt_impl.hpp new/libopenmpt-0.3.11+release.autotools/libopenmpt/libopenmpt_impl.hpp --- old/libopenmpt-0.3.9+release.autotools/libopenmpt/libopenmpt_impl.hpp 2017-09-18 14:00:33.000000000 +0200 +++ new/libopenmpt-0.3.11+release.autotools/libopenmpt/libopenmpt_impl.hpp 2018-05-30 17:14:01.000000000 +0200 @@ -87,6 +87,7 @@ double m_currentPositionSeconds; std::unique_ptr<OpenMPT::CSoundFile> m_sndFile; bool m_loaded; + bool m_mixer_initialized; std::unique_ptr<OpenMPT::Dither> m_Dither; subsongs_type m_subsongs; float m_Gain; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/libopenmpt/libopenmpt_version.h new/libopenmpt-0.3.11+release.autotools/libopenmpt/libopenmpt_version.h --- old/libopenmpt-0.3.9+release.autotools/libopenmpt/libopenmpt_version.h 2018-04-29 08:08:21.000000000 +0200 +++ new/libopenmpt-0.3.11+release.autotools/libopenmpt/libopenmpt_version.h 2018-07-28 13:48:29.000000000 +0200 @@ -19,7 +19,7 @@ /*! \brief libopenmpt minor version number */ #define OPENMPT_API_VERSION_MINOR 3 /*! \brief libopenmpt patch version number */ -#define OPENMPT_API_VERSION_PATCH 9 +#define OPENMPT_API_VERSION_PATCH 11 /*! \brief libopenmpt pre-release tag */ #define OPENMPT_API_VERSION_PREREL "" /*! \brief libopenmpt pre-release flag */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/libopenmpt/libopenmpt_version.mk new/libopenmpt-0.3.11+release.autotools/libopenmpt/libopenmpt_version.mk --- old/libopenmpt-0.3.9+release.autotools/libopenmpt/libopenmpt_version.mk 2018-04-29 08:08:21.000000000 +0200 +++ new/libopenmpt-0.3.11+release.autotools/libopenmpt/libopenmpt_version.mk 2018-07-28 13:48:29.000000000 +0200 @@ -1,8 +1,8 @@ LIBOPENMPT_VERSION_MAJOR=0 LIBOPENMPT_VERSION_MINOR=3 -LIBOPENMPT_VERSION_PATCH=9 +LIBOPENMPT_VERSION_PATCH=11 LIBOPENMPT_VERSION_PREREL= LIBOPENMPT_LTVER_CURRENT=1 -LIBOPENMPT_LTVER_REVISION=9 +LIBOPENMPT_LTVER_REVISION=11 LIBOPENMPT_LTVER_AGE=1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/man/openmpt123.1 new/libopenmpt-0.3.11+release.autotools/man/openmpt123.1 --- old/libopenmpt-0.3.9+release.autotools/man/openmpt123.1 2018-04-29 08:12:46.000000000 +0200 +++ new/libopenmpt-0.3.11+release.autotools/man/openmpt123.1 2018-07-28 13:57:30.000000000 +0200 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.4. -.TH OPENMPT123 "1" "April 2018" "openmpt123 v0.3.9" "User Commands" +.TH OPENMPT123 "1" "July 2018" "openmpt123 v0.3.11" "User Commands" .SH NAME openmpt123 - command line module music player based on libopenmpt .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/openmpt123/openmpt123.cpp new/libopenmpt-0.3.11+release.autotools/openmpt123/openmpt123.cpp --- old/libopenmpt-0.3.9+release.autotools/openmpt123/openmpt123.cpp 2018-04-23 19:20:15.000000000 +0200 +++ new/libopenmpt-0.3.11+release.autotools/openmpt123/openmpt123.cpp 2018-07-05 14:26:31.000000000 +0200 @@ -99,35 +99,35 @@ namespace openmpt123 { struct silent_exit_exception : public std::exception { - silent_exit_exception() throw() { } + silent_exit_exception() { } }; struct show_license_exception : public std::exception { - show_license_exception() throw() { } + show_license_exception() { } }; struct show_credits_exception : public std::exception { - show_credits_exception() throw() { } + show_credits_exception() { } }; struct show_man_version_exception : public std::exception { - show_man_version_exception() throw() { } + show_man_version_exception() { } }; struct show_man_help_exception : public std::exception { - show_man_help_exception() throw() { } + show_man_help_exception() { } }; struct show_short_version_number_exception : public std::exception { - show_short_version_number_exception() throw() { } + show_short_version_number_exception() { } }; struct show_version_number_exception : public std::exception { - show_version_number_exception() throw() { } + show_version_number_exception() { } }; struct show_long_version_number_exception : public std::exception { - show_long_version_number_exception() throw() { } + show_long_version_number_exception() { } }; bool IsTerminal( int fd ) { @@ -888,10 +888,16 @@ }; static std::string channel_to_string( int channels, int channel, const meter_channel & meter, bool tiny = false ) { - float db = 20.0f * std::log10( meter.peak ); - float db_hold = 20.0f * std::log10( meter.hold ); - int val = static_cast<int>( db + 48.0f ); - int hold_pos = static_cast<int>( db_hold + 48.0f ); + int val = std::numeric_limits<int>::min(); + int hold_pos = std::numeric_limits<int>::min(); + if ( meter.peak > 0.0f ) { + float db = 20.0f * std::log10( meter.peak ); + val = static_cast<int>( db + 48.0f ); + } + if ( meter.hold > 0.0f ) { + float db_hold = 20.0f * std::log10( meter.hold ); + hold_pos = static_cast<int>( db_hold + 48.0f ); + } if ( val < 0 ) { val = 0; } @@ -911,13 +917,13 @@ headroom = 0; } if ( tiny ) { - if ( meter.clip != 0.0f || db >= 0.0f ) { + if ( meter.clip != 0.0f || meter.peak >= 1.0f ) { return "#"; - } else if ( db > -6.0f ) { + } else if ( meter.peak > std::pow( 10.0f, -6.0f / 20.0f ) ) { return "O"; - } else if ( db > -12.0f ) { + } else if ( meter.peak > std::pow( 10.0f, -12.0f / 20.0f ) ) { return "o"; - } else if ( db > -18.0f ) { + } else if ( meter.peak > std::pow( 10.0f, -18.0f / 20.0f ) ) { return "."; } else { return " "; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/openmpt123/openmpt123.hpp new/libopenmpt-0.3.11+release.autotools/openmpt123/openmpt123.hpp --- old/libopenmpt-0.3.9+release.autotools/openmpt123/openmpt123.hpp 2017-11-01 18:38:35.000000000 +0100 +++ new/libopenmpt-0.3.11+release.autotools/openmpt123/openmpt123.hpp 2018-07-05 14:25:37.000000000 +0200 @@ -15,7 +15,7 @@ namespace openmpt123 { struct exception : public openmpt::exception { - exception( const std::string & text ) throw() : openmpt::exception(text) { } + exception( const std::string & text ) : openmpt::exception(text) { } }; struct show_help_exception { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/openmpt123/openmpt123_portaudio.hpp new/libopenmpt-0.3.11+release.autotools/openmpt123/openmpt123_portaudio.hpp --- old/libopenmpt-0.3.9+release.autotools/openmpt123/openmpt123_portaudio.hpp 2016-09-02 20:04:54.000000000 +0200 +++ new/libopenmpt-0.3.11+release.autotools/openmpt123/openmpt123_portaudio.hpp 2018-07-05 14:25:37.000000000 +0200 @@ -20,7 +20,7 @@ namespace openmpt123 { struct portaudio_exception : public exception { - portaudio_exception( PaError code ) throw() : exception( Pa_GetErrorText( code ) ) { } + portaudio_exception( PaError code ) : exception( Pa_GetErrorText( code ) ) { } }; typedef void (*PaUtilLogCallback ) (const char *log); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/openmpt123/openmpt123_pulseaudio.hpp new/libopenmpt-0.3.11+release.autotools/openmpt123/openmpt123_pulseaudio.hpp --- old/libopenmpt-0.3.9+release.autotools/openmpt123/openmpt123_pulseaudio.hpp 2016-09-03 22:07:36.000000000 +0200 +++ new/libopenmpt-0.3.11+release.autotools/openmpt123/openmpt123_pulseaudio.hpp 2018-07-05 14:25:37.000000000 +0200 @@ -42,7 +42,7 @@ return std::string(); } } - pulseaudio_exception( int error ) throw() : exception( error_to_string( error ) ) { } + pulseaudio_exception( int error ) : exception( error_to_string( error ) ) { } }; class pulseaudio_stream_raii : public write_buffers_interface { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/openmpt123/openmpt123_sdl.hpp new/libopenmpt-0.3.11+release.autotools/openmpt123/openmpt123_sdl.hpp --- old/libopenmpt-0.3.9+release.autotools/openmpt123/openmpt123_sdl.hpp 2015-05-22 21:02:20.000000000 +0200 +++ new/libopenmpt-0.3.11+release.autotools/openmpt123/openmpt123_sdl.hpp 2018-07-05 14:25:37.000000000 +0200 @@ -26,7 +26,7 @@ namespace openmpt123 { struct sdl_exception : public exception { - sdl_exception( int /*code*/ ) throw() : exception( "SDL error" ) { } + sdl_exception( int /*code*/ ) : exception( "SDL error" ) { } }; class sdl_stream_raii : public write_buffers_blocking_wrapper { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/openmpt123/openmpt123_sdl2.hpp new/libopenmpt-0.3.11+release.autotools/openmpt123/openmpt123_sdl2.hpp --- old/libopenmpt-0.3.9+release.autotools/openmpt123/openmpt123_sdl2.hpp 2016-03-24 15:09:51.000000000 +0100 +++ new/libopenmpt-0.3.11+release.autotools/openmpt123/openmpt123_sdl2.hpp 2018-07-05 14:25:37.000000000 +0200 @@ -26,7 +26,7 @@ namespace openmpt123 { struct sdl2_exception : public exception { - sdl2_exception( int /*code*/ ) throw() : exception( "SDL2 error" ) { } + sdl2_exception( int /*code*/ ) : exception( "SDL2 error" ) { } }; static void check_sdl2_error( int e ) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/openmpt123/openmpt123_waveout.hpp new/libopenmpt-0.3.11+release.autotools/openmpt123/openmpt123_waveout.hpp --- old/libopenmpt-0.3.9+release.autotools/openmpt123/openmpt123_waveout.hpp 2016-09-02 20:04:54.000000000 +0200 +++ new/libopenmpt-0.3.11+release.autotools/openmpt123/openmpt123_waveout.hpp 2018-07-05 14:25:37.000000000 +0200 @@ -18,7 +18,7 @@ namespace openmpt123 { struct waveout_exception : public exception { - waveout_exception() throw() : exception( "waveout" ) { } + waveout_exception() : exception( "waveout" ) { } }; class waveout_stream_raii : public write_buffers_interface { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/sounddsp/Reverb.cpp new/libopenmpt-0.3.11+release.autotools/sounddsp/Reverb.cpp --- old/libopenmpt-0.3.9+release.autotools/sounddsp/Reverb.cpp 2017-09-24 09:24:38.000000000 +0200 +++ new/libopenmpt-0.3.11+release.autotools/sounddsp/Reverb.cpp 2018-05-30 11:35:08.000000000 +0200 @@ -64,6 +64,8 @@ CReverb::CReverb() { + m_currentPreset = nullptr; + // Shared reverb state InitMixBuffer(MixReverbBuffer, static_cast<uint32>(mpt::size(MixReverbBuffer))); gnRvbROfsVol = 0; @@ -326,18 +328,17 @@ void CReverb::Initialize(bool bReset, uint32 MixingFreq) { if (m_Settings.m_nReverbType >= NUM_REVERBTYPES) m_Settings.m_nReverbType = 0; - static SNDMIX_REVERB_PROPERTIES *spCurrentPreset = nullptr; - SNDMIX_REVERB_PROPERTIES *pRvbPreset = &gRvbPresets[m_Settings.m_nReverbType].Preset; + const SNDMIX_REVERB_PROPERTIES *rvbPreset = &gRvbPresets[m_Settings.m_nReverbType].Preset; - if ((pRvbPreset != spCurrentPreset) || (bReset)) + if ((rvbPreset != m_currentPreset) || (bReset)) { // Reverb output frequency is half of the dry output rate float flOutputFrequency = (float)MixingFreq; EnvironmentReverb rvb; // Reset reverb parameters - spCurrentPreset = pRvbPreset; - I3dl2_to_Generic(pRvbPreset, &rvb, flOutputFrequency, + m_currentPreset = rvbPreset; + I3dl2_to_Generic(rvbPreset, &rvb, flOutputFrequency, RVBMINREFDELAY, RVBMAXREFDELAY, RVBMINRVBDELAY, RVBMAXRVBDELAY, ( RVBDIF1L_LEN + RVBDIF1R_LEN diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/sounddsp/Reverb.h new/libopenmpt-0.3.11+release.autotools/sounddsp/Reverb.h --- old/libopenmpt-0.3.9+release.autotools/sounddsp/Reverb.h 2017-09-24 09:24:38.000000000 +0200 +++ new/libopenmpt-0.3.11+release.autotools/sounddsp/Reverb.h 2018-05-30 11:35:08.000000000 +0200 @@ -59,6 +59,8 @@ LR16 RefOut[SNDMIX_REVERB_DELAY_MASK + 1]; // stereo output of reflections }; +struct SNDMIX_REVERB_PROPERTIES; + // Late reverberation // Tank diffusers lengths @@ -145,6 +147,7 @@ mixsample_t gnRvbROfsVol, gnRvbLOfsVol; private: + const SNDMIX_REVERB_PROPERTIES *m_currentPreset; uint32 gnReverbSend; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/soundlib/AudioReadTarget.h new/libopenmpt-0.3.11+release.autotools/soundlib/AudioReadTarget.h --- old/libopenmpt-0.3.9+release.autotools/soundlib/AudioReadTarget.h 2017-09-24 09:24:38.000000000 +0200 +++ new/libopenmpt-0.3.11+release.autotools/soundlib/AudioReadTarget.h 2018-07-16 13:11:25.000000000 +0200 @@ -8,6 +8,8 @@ */ +#pragma once + #include "Sndfile.h" #include "Dither.h" #include "../soundbase/SampleFormat.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/soundlib/Load_amf.cpp new/libopenmpt-0.3.11+release.autotools/soundlib/Load_amf.cpp --- old/libopenmpt-0.3.9+release.autotools/soundlib/Load_amf.cpp 2017-09-24 09:24:38.000000000 +0200 +++ new/libopenmpt-0.3.11+release.autotools/soundlib/Load_amf.cpp 2018-07-27 23:56:44.000000000 +0200 @@ -137,6 +137,7 @@ InitializeGlobals(MOD_TYPE_AMF0); InitializeChannels(); + SetupMODPanning(true); m_nChannels = 8; m_nDefaultSpeed = fileHeader.defaultSpeed; m_nDefaultTempo.Set(fileHeader.defaultTempo); @@ -185,6 +186,13 @@ m.command = data[2]; m.param = data[3]; ConvertModCommand(m); +#ifdef MODPLUG_TRACKER + if(m.command == CMD_PANNING8) + { + // Convert 7-bit panning to 8-bit + m.param = mpt::saturate_cast<ModCommand::PARAM>(m.param * 2u); + } +#endif } } @@ -574,8 +582,9 @@ for(uint16 i = 0; i < trackCount; i++) { // Track size is a 24-Bit value describing the number of byte triplets in this track. - uint32 trackSize = file.ReadUint16LE() | (file.ReadUint8() << 16); - trackData[i] = file.ReadChunk(trackSize * 3); + uint8 trackSize[3]; + file.ReadArray(trackSize); + trackData[i] = file.ReadChunk((trackSize[0] | (trackSize[1] << 8) | (trackSize[2] << 16)) * 3); } if(loadFlags & loadSampleData) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/soundlib/Load_far.cpp new/libopenmpt-0.3.11+release.autotools/soundlib/Load_far.cpp --- old/libopenmpt-0.3.9+release.autotools/soundlib/Load_far.cpp 2017-09-24 09:24:38.000000000 +0200 +++ new/libopenmpt-0.3.11+release.autotools/soundlib/Load_far.cpp 2018-05-06 16:48:53.000000000 +0200 @@ -234,7 +234,7 @@ continue; } - // Read break row and unused value + // Read break row and unused value (used to be pattern tempo) ROWINDEX breakRow = patternChunk.ReadUint8(); patternChunk.Skip(1); if(breakRow > 0 && breakRow < numRows - 2) @@ -262,10 +262,10 @@ m.instr = data[1] + 1; } - if(data[2] & 0x0F) + if(m.note != NOTE_NONE || data[2] > 0) { m.volcmd = VOLCMD_VOLUME; - m.vol = (data[2] & 0x0F) << 2; + m.vol = (Clamp(data[2], uint8(1), uint8(16)) - 1u) * 4u; } m.param = data[3] & 0x0F; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/soundlib/Load_mid.cpp new/libopenmpt-0.3.11+release.autotools/soundlib/Load_mid.cpp --- old/libopenmpt-0.3.9+release.autotools/soundlib/Load_mid.cpp 2018-02-27 14:02:53.000000000 +0100 +++ new/libopenmpt-0.3.11+release.autotools/soundlib/Load_mid.cpp 2018-05-19 13:36:18.000000000 +0200 @@ -1083,7 +1083,7 @@ chn = 9; else if(chn < 10) chn--; - drumChns.set(chn, xg[7] != 0); + drumChns.set(chn, sysex.ReadUint8() != 0); } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/soundlib/Load_psm.cpp new/libopenmpt-0.3.11+release.autotools/soundlib/Load_psm.cpp --- old/libopenmpt-0.3.9+release.autotools/soundlib/Load_psm.cpp 2017-09-24 09:24:38.000000000 +0200 +++ new/libopenmpt-0.3.11+release.autotools/soundlib/Load_psm.cpp 2018-06-13 07:45:57.000000000 +0200 @@ -435,11 +435,15 @@ // Output of PLAY.EXE: "SMapTabl from pos 0 to pos -1 starting at 0 and adding 1 to it each time" // It appears that this maps e.g. what is "I0" in the file to sample 1. // If we were being fancy, we could implement this, but in practice it won't matter. - if (subChunk.ReadUint8() != 0x00 || subChunk.ReadUint8() != 0xFF || // "0 to -1" (does not seem to do anything) - subChunk.ReadUint8() != 0x00 || subChunk.ReadUint8() != 0x00 || // "at 0" (actually this appears to be the adding part - changing this to 0x01 0x00 offsets all samples by 1) - subChunk.ReadUint8() != 0x01 || subChunk.ReadUint8() != 0x00) // "adding 1" (does not seem to do anything) { - return false; + uint8 mapTable[6]; + if(!subChunk.ReadArray(mapTable) + || mapTable[0] != 0x00 || mapTable[1] != 0xFF // "0 to -1" (does not seem to do anything) + || mapTable[2] != 0x00 || mapTable[3] != 0x00 // "at 0" (actually this appears to be the adding part - changing this to 0x01 0x00 offsets all samples by 1) + || mapTable[4] != 0x01 || mapTable[5] != 0x00) // "adding 1" (does not seem to do anything) + { + return false; + } } break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/soundlib/Load_s3m.cpp new/libopenmpt-0.3.11+release.autotools/soundlib/Load_s3m.cpp --- old/libopenmpt-0.3.9+release.autotools/soundlib/Load_s3m.cpp 2018-03-20 17:42:08.000000000 +0100 +++ new/libopenmpt-0.3.11+release.autotools/soundlib/Load_s3m.cpp 2018-06-09 21:43:31.000000000 +0200 @@ -439,7 +439,7 @@ if(hasAdlibPatches) { - AddToLog("This track uses Adlib instruments, which are not supported by OpenMPT."); + AddToLog("This track uses Adlib instruments, which are not supported by this version of OpenMPT."); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/soundlib/OggStream.h new/libopenmpt-0.3.11+release.autotools/soundlib/OggStream.h --- old/libopenmpt-0.3.9+release.autotools/soundlib/OggStream.h 2017-04-03 15:20:34.000000000 +0200 +++ new/libopenmpt-0.3.11+release.autotools/soundlib/OggStream.h 2018-07-16 13:11:25.000000000 +0200 @@ -8,6 +8,8 @@ */ +#pragma once + #include "../common/Endianness.h" #include "../common/mptIO.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/soundlib/SampleFormatMediaFoundation.cpp new/libopenmpt-0.3.11+release.autotools/soundlib/SampleFormatMediaFoundation.cpp --- old/libopenmpt-0.3.9+release.autotools/soundlib/SampleFormatMediaFoundation.cpp 2017-09-24 09:24:38.000000000 +0200 +++ new/libopenmpt-0.3.11+release.autotools/soundlib/SampleFormatMediaFoundation.cpp 2018-05-08 20:16:23.000000000 +0200 @@ -454,6 +454,12 @@ result = true; + if(!mo3Decode) + { + Samples[sample].Convert(MOD_TYPE_IT, GetType()); + Samples[sample].PrecomputeLoops(*this, false); + } + fail: mptMFSafeRelease(&buffer); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/soundlib/SampleFormats.cpp new/libopenmpt-0.3.11+release.autotools/soundlib/SampleFormats.cpp --- old/libopenmpt-0.3.9+release.autotools/soundlib/SampleFormats.cpp 2018-04-19 18:03:50.000000000 +0200 +++ new/libopenmpt-0.3.11+release.autotools/soundlib/SampleFormats.cpp 2018-05-26 19:38:45.000000000 +0200 @@ -254,7 +254,7 @@ } #ifdef MODPLUG_TRACKER - if(!strcmp(pIns->filename, "") && srcSong.GetpModDoc() != nullptr) + if(!strcmp(pIns->filename, "") && srcSong.GetpModDoc() != nullptr && &srcSong != this) { mpt::String::Copy(pIns->filename, srcSong.GetpModDoc()->GetPathNameMpt().GetFullFileName().ToLocale()); } @@ -307,7 +307,7 @@ } #ifdef MODPLUG_TRACKER - if(!strcmp(targetSmp.filename, "") && srcSong.GetpModDoc() != nullptr) + if(!strcmp(targetSmp.filename, "") && srcSong.GetpModDoc() != nullptr && &srcSong != this) { mpt::String::Copy(targetSmp.filename, mpt::ToCharset(GetCharsetInternal(), srcSong.GetpModDoc()->GetTitle())); } @@ -446,7 +446,11 @@ } else if(wavFile.GetSampleFormat() == WAVFormatChunk::fmtMP3) { // MP3 in WAV - return ReadMP3Sample(nSample, sampleChunk, true) || ReadMediaFoundationSample(nSample, sampleChunk, true); + bool loadedMP3 = ReadMP3Sample(nSample, sampleChunk, true) || ReadMediaFoundationSample(nSample, sampleChunk, true); + if(!loadedMP3) + { + return false; + } } else if(!wavFile.IsExtensibleFormat() && wavFile.MayBeCoolEdit16_8() && wavFile.GetSampleFormat() == WAVFormatChunk::fmtPCM && wavFile.GetBitsPerSample() == 32 && wavFile.GetBlockAlign() == wavFile.GetNumChannels() * 4) { // Syntrillium Cool Edit hack to store IEEE 32bit floating point diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/soundlib/Snd_fx.cpp new/libopenmpt-0.3.11+release.autotools/soundlib/Snd_fx.cpp --- old/libopenmpt-0.3.9+release.autotools/soundlib/Snd_fx.cpp 2018-04-07 18:05:43.000000000 +0200 +++ new/libopenmpt-0.3.11+release.autotools/soundlib/Snd_fx.cpp 2018-07-27 23:56:44.000000000 +0200 @@ -1416,7 +1416,7 @@ pChn->nNewIns = 0; // IT Compatiblity: NNA is reset on every note change, not every instrument change (fixes s7xinsnum.it). - if (pIns && ((!m_playBehaviour[kITNNAReset] && pSmp) || pIns->nMixPlug)) + if (pIns && ((!m_playBehaviour[kITNNAReset] && pSmp) || pIns->nMixPlug || instrumentChanged)) pChn->nNNA = pIns->nNNA; // Update volume @@ -2177,11 +2177,11 @@ IMixPlugin *pPlugin = nullptr; if(srcChn.HasMIDIOutput() && ModCommand::IsNote(srcChn.nNote)) // instro sends to a midi chan { - PLUGINDEX nPlugin = GetBestPlugin(nChn, PrioritiseInstrument, RespectMutes); + PLUGINDEX plugin = GetBestPlugin(nChn, PrioritiseInstrument, RespectMutes); - if(nPlugin > 0 && nPlugin <= MAX_MIXPLUGINS) + if(plugin > 0 && plugin <= MAX_MIXPLUGINS) { - pPlugin = m_MixPlugins[nPlugin-1].pMixPlugin; + pPlugin = m_MixPlugins[plugin - 1].pMixPlugin; if(pPlugin) { // apply NNA to this plugin iff it is currently playing a note on this tracker channel @@ -2193,7 +2193,7 @@ #endif // NO_PLUGINS // New Note Action - if((srcChn.nRealVolume > 0 && srcChn.nLength > 0) || applyNNAtoPlug) + if(srcChn.IsSamplePlaying() || applyNNAtoPlug) { nnaChn = GetNNAChannel(nChn); if(nnaChn != 0) @@ -2209,16 +2209,12 @@ #ifndef NO_PLUGINS if(applyNNAtoPlug && pPlugin) { - //Move note to the NNA channel (odd, but makes sense with DNA stuff). - //Actually a bad idea since it then become very hard to kill some notes. - //pPlugin->MoveNote(pChn.nNote, pChn.pModInstrument->nMidiChannel, nChn, n); switch(srcChn.nNNA) { case NNA_NOTEOFF: case NNA_NOTECUT: case NNA_NOTEFADE: - //switch off note played on this plugin, on this tracker channel and midi channel - //pPlugin->MidiCommand(pChn.pModInstrument->nMidiChannel, pChn.pModInstrument->nMidiProgram, pChn.nNote + NOTE_MAX_SPECIAL, 0, n); + // Switch off note played on this plugin, on this tracker channel and midi channel SendMIDINote(nChn, NOTE_KEYOFF, 0); srcChn.nArpeggioLastNote = NOTE_NONE; break; @@ -2300,8 +2296,8 @@ const bool isFirstTick = m_SongFlags[SONG_FIRSTTICK]; if(isFirstTick) pChn->m_RowPlug = pChn->rowCommand.instr; - const PLUGINDEX nPlug = pChn->m_RowPlug; - const bool hasValidPlug = (nPlug > 0 && nPlug <= MAX_MIXPLUGINS && m_MixPlugins[nPlug-1].pMixPlugin); + const PLUGINDEX plugin = pChn->m_RowPlug; + const bool hasValidPlug = (plugin > 0 && plugin <= MAX_MIXPLUGINS && m_MixPlugins[plugin - 1].pMixPlugin); if(hasValidPlug) { if(isFirstTick) @@ -2311,14 +2307,14 @@ { PlugParamValue targetvalue = ModCommand::GetValueEffectCol(pChn->rowCommand.command, pChn->rowCommand.param) / PlugParamValue(ModCommand::maxColumnValue); pChn->m_plugParamTargetValue = targetvalue; - pChn->m_plugParamValueStep = (targetvalue - m_MixPlugins[nPlug-1].pMixPlugin->GetParameter(plugparam)) / float(GetNumTicksOnCurrentRow()); + pChn->m_plugParamValueStep = (targetvalue - m_MixPlugins[plugin-1].pMixPlugin->GetParameter(plugparam)) / float(GetNumTicksOnCurrentRow()); } if(m_PlayState.m_nTickCount + 1 == GetNumTicksOnCurrentRow()) { // On last tick, set parameter exactly to target value. - m_MixPlugins[nPlug-1].pMixPlugin->SetParameter(plugparam, pChn->m_plugParamTargetValue); + m_MixPlugins[plugin - 1].pMixPlugin->SetParameter(plugparam, pChn->m_plugParamTargetValue); } else - m_MixPlugins[nPlug-1].pMixPlugin->ModifyParameter(plugparam, pChn->m_plugParamValueStep); + m_MixPlugins[plugin - 1].pMixPlugin->ModifyParameter(plugparam, pChn->m_plugParamValueStep); } #endif // NO_PLUGINS } @@ -2778,7 +2774,7 @@ InstrumentChange(pChn, pChn->nNewIns, bPorta, false, !(GetType() & (MOD_TYPE_XM|MOD_TYPE_MT2))); pChn->nNewIns = 0; } - NoteChange(pChn, note, bPorta, !(GetType() & (MOD_TYPE_XM|MOD_TYPE_MT2))); + NoteChange(pChn, note, bPorta, !(GetType() & (MOD_TYPE_XM | MOD_TYPE_MT2))); if ((bPorta) && (GetType() & (MOD_TYPE_XM|MOD_TYPE_MT2)) && (instr)) { pChn->dwFlags.set(CHN_FASTVOLRAMP); @@ -4066,7 +4062,7 @@ pChn->nPan = param * 4; } else { - if(!(GetType() & (MOD_TYPE_S3M | MOD_TYPE_DSM | MOD_TYPE_AMF | MOD_TYPE_MTM))) + if(!(GetType() & (MOD_TYPE_S3M | MOD_TYPE_DSM | MOD_TYPE_AMF0 | MOD_TYPE_AMF | MOD_TYPE_MTM))) { // Real 8-bit panning pChn->nPan = param; @@ -4936,16 +4932,16 @@ } else if(macroCode == 0x03 && !isExtended) { // F0.F0.03.xx: Set plug dry/wet - const PLUGINDEX nPlug = (plugin != 0) ? plugin : GetBestPlugin(nChn, PrioritiseChannel, EvenIfMuted); - if ((nPlug) && (nPlug <= MAX_MIXPLUGINS) && param < 0x80) + const PLUGINDEX plug = (plugin != 0) ? plugin : GetBestPlugin(nChn, PrioritiseChannel, EvenIfMuted); + if(plug > 0 && plug <= MAX_MIXPLUGINS && param < 0x80) { const float newRatio = 1.0f - (static_cast<float>(param & 0x7F) / 127.0f); if(!isSmooth) { - m_MixPlugins[nPlug - 1].fDryRatio = newRatio; + m_MixPlugins[plug - 1].fDryRatio = newRatio; } else { - m_MixPlugins[nPlug - 1].fDryRatio = CalculateSmoothParamChange(m_MixPlugins[nPlug - 1].fDryRatio, newRatio); + m_MixPlugins[plug - 1].fDryRatio = CalculateSmoothParamChange(m_MixPlugins[plug - 1].fDryRatio, newRatio); } } @@ -4953,11 +4949,11 @@ } else if((macroCode & 0x80) || isExtended) { // F0.F0.{80|n}.xx / F0.F1.n.xx: Set VST effect parameter n to xx - const PLUGINDEX nPlug = (plugin != 0) ? plugin : GetBestPlugin(nChn, PrioritiseChannel, EvenIfMuted); + const PLUGINDEX plug = (plugin != 0) ? plugin : GetBestPlugin(nChn, PrioritiseChannel, EvenIfMuted); const uint32 plugParam = isExtended ? (0x80 + macroCode) : (macroCode & 0x7F); - if((nPlug) && (nPlug <= MAX_MIXPLUGINS)) + if(plug > 0 && plug <= MAX_MIXPLUGINS) { - IMixPlugin *pPlugin = m_MixPlugins[nPlug - 1].pMixPlugin; + IMixPlugin *pPlugin = m_MixPlugins[plug - 1].pMixPlugin; if(pPlugin && param < 0x80) { const float fParam = param / 127.0f; @@ -4984,15 +4980,15 @@ const CHANNELINDEX plugChannel = (nChn < GetNumChannels()) ? nChn + 1 : chn.nMasterChn; if(plugChannel > 0 && plugChannel <= GetNumChannels()) // XXX do we need this? I guess it might be relevant for previewing notes in the pattern... Or when using this mechanism for volume/panning! { - PLUGINDEX nPlug = 0; + PLUGINDEX plug = 0; if(!chn.dwFlags[CHN_NOFX]) { - nPlug = (plugin != 0) ? plugin : GetBestPlugin(nChn, PrioritiseChannel, EvenIfMuted); + plug = (plugin != 0) ? plugin : GetBestPlugin(nChn, PrioritiseChannel, EvenIfMuted); } - if(nPlug > 0 && nPlug <= MAX_MIXPLUGINS) + if(plug > 0 && plug <= MAX_MIXPLUGINS) { - IMixPlugin *pPlugin = m_MixPlugins[nPlug - 1].pMixPlugin; + IMixPlugin *pPlugin = m_MixPlugins[plug - 1].pMixPlugin; if (pPlugin != nullptr) { if(macro[0] == 0xF0) @@ -5033,10 +5029,10 @@ // instro sends to a midi chan if (pIns && pIns->HasValidMIDIChannel()) { - PLUGINDEX nPlug = pIns->nMixPlug; - if ((nPlug) && (nPlug <= MAX_MIXPLUGINS)) + PLUGINDEX plug = pIns->nMixPlug; + if(plug > 0 && plug <= MAX_MIXPLUGINS) { - IMixPlugin *pPlug = m_MixPlugins[nPlug-1].pMixPlugin; + IMixPlugin *pPlug = m_MixPlugins[plug - 1].pMixPlugin; if (pPlug != nullptr) { pPlug->MidiCommand(GetBestMidiChannel(chn), pIns->nMidiProgram, pIns->wMidiBank, note, volume, chn); @@ -5771,32 +5767,32 @@ } //Define search source order - PLUGINDEX nPlugin = 0; + PLUGINDEX plugin = 0; switch (priority) { case ChannelOnly: - nPlugin = GetChannelPlugin(nChn, respectMutes); + plugin = GetChannelPlugin(nChn, respectMutes); break; case InstrumentOnly: - nPlugin = GetActiveInstrumentPlugin(nChn, respectMutes); + plugin = GetActiveInstrumentPlugin(nChn, respectMutes); break; case PrioritiseInstrument: - nPlugin = GetActiveInstrumentPlugin(nChn, respectMutes); - if ((!nPlugin) || (nPlugin > MAX_MIXPLUGINS)) + plugin = GetActiveInstrumentPlugin(nChn, respectMutes); + if(!plugin || plugin > MAX_MIXPLUGINS) { - nPlugin = GetChannelPlugin(nChn, respectMutes); + plugin = GetChannelPlugin(nChn, respectMutes); } break; case PrioritiseChannel: - nPlugin = GetChannelPlugin(nChn, respectMutes); - if ((!nPlugin) || (nPlugin > MAX_MIXPLUGINS)) + plugin = GetChannelPlugin(nChn, respectMutes); + if(!plugin || plugin > MAX_MIXPLUGINS) { - nPlugin = GetActiveInstrumentPlugin(nChn, respectMutes); + plugin = GetActiveInstrumentPlugin(nChn, respectMutes); } break; } - return nPlugin; // 0 Means no plugin found. + return plugin; // 0 Means no plugin found. } @@ -5804,10 +5800,10 @@ { const ModChannel &channel = m_PlayState.Chn[nChn]; - PLUGINDEX nPlugin; + PLUGINDEX plugin; if((respectMutes == RespectMutes && channel.dwFlags[CHN_MUTE]) || channel.dwFlags[CHN_NOFX]) { - nPlugin = 0; + plugin = 0; } else { // If it looks like this is an NNA channel, we need to find the master channel. @@ -5820,13 +5816,13 @@ if(nChn < MAX_BASECHANNELS) { - nPlugin = ChnSettings[nChn].nMixPlugin; + plugin = ChnSettings[nChn].nMixPlugin; } else { - nPlugin = 0; + plugin = 0; } } - return nPlugin; + return plugin; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/soundlib/tuning.cpp new/libopenmpt-0.3.11+release.autotools/soundlib/tuning.cpp --- old/libopenmpt-0.3.9+release.autotools/soundlib/tuning.cpp 2018-01-07 15:21:49.000000000 +0100 +++ new/libopenmpt-0.3.11+release.autotools/soundlib/tuning.cpp 2018-07-26 08:13:13.000000000 +0200 @@ -196,6 +196,10 @@ RATIOTYPE CTuningRTI::GetRatio(const NOTEINDEXTYPE& baseNote, const STEPINDEXTYPE& baseStepDiff) const { const STEPINDEXTYPE fsCount = static_cast<STEPINDEXTYPE>(GetFineStepCount()); + if(fsCount < 0 || fsCount > FINESTEPCOUNT_MAX) + { + return s_DefaultFallbackRatio; + } if(fsCount == 0 || baseStepDiff == 0) { return GetRatio(static_cast<NOTEINDEXTYPE>(baseNote + baseStepDiff)); @@ -222,8 +226,10 @@ RATIOTYPE CTuningRTI::GetRatioFine(const NOTEINDEXTYPE& note, USTEPINDEXTYPE sd) const { - if(GetFineStepCount() <= 0) - return 1; + if(GetFineStepCount() <= 0 || GetFineStepCount() > static_cast<USTEPINDEXTYPE>(FINESTEPCOUNT_MAX)) + { + return s_DefaultFallbackRatio; + } //Neither of these should happen. if(sd <= 0) sd = 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.3.9+release.autotools/test/test.cpp new/libopenmpt-0.3.11+release.autotools/test/test.cpp --- old/libopenmpt-0.3.9+release.autotools/test/test.cpp 2018-01-21 14:25:19.000000000 +0100 +++ new/libopenmpt-0.3.11+release.autotools/test/test.cpp 2018-07-26 15:32:08.000000000 +0200 @@ -1669,6 +1669,17 @@ VERIFY_EQUAL(Gregorian::FromTM(mpt::Date::Unix( 1413064016).AsUTC()), TestDate2( 56, 46, 21, 11, 10, 2014 )); VERIFY_EQUAL(Gregorian::FromTM(mpt::Date::Unix( 1413064100).AsUTC()), TestDate2( 20, 48, 21, 11, 10, 2014 )); + // https://github.com/kripken/emscripten/issues/4251 + #if MPT_OS_EMSCRIPTEN + volatile int transpose = 32; + volatile int finetune = 0; + float exp = (transpose * 128.0f + finetune) * (1.0f / (12.0f * 128.0f)); + float f = ::powf(2.0f, exp); + double d = ::pow (2.0 , (double)exp); + VERIFY_EQUAL_EPS(d, 6.349605, 0.00001); + VERIFY_EQUAL_EPS(f, 6.349605, 0.00001); + #endif + }
