Hello community, here is the log from the commit of package libopenmpt for openSUSE:Factory checked in at 2019-01-26 22:18:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libopenmpt (Old) and /work/SRC/openSUSE:Factory/.libopenmpt.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libopenmpt" Sat Jan 26 22:18:25 2019 rev:16 rq:667846 version:0.4.2 Changes: -------- --- /work/SRC/openSUSE:Factory/libopenmpt/libopenmpt.changes 2019-01-08 12:19:32.320862612 +0100 +++ /work/SRC/openSUSE:Factory/.libopenmpt.new.28833/libopenmpt.changes 2019-01-26 22:18:27.499048054 +0100 @@ -1,0 +2,10 @@ +Tue Jan 22 18:17:07 UTC 2019 - Martin Herkt <9+suse@cirno.systems> + +- Update to version 0.4.2: + * [Sec] DSM: Assertion failure during file parsing with debug + STLs. + * [Sec] J2B: Assertion failure during file parsing with debug + STLs. + * S3M: Allow volume change of OPL instruments after Note Cut. + +------------------------------------------------------------------- Old: ---- libopenmpt-0.4.1+release.autotools.tar.gz New: ---- libopenmpt-0.4.2+release.autotools.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libopenmpt.spec ++++++ --- /var/tmp/diff_new_pack.OmVIDb/_old 2019-01-26 22:18:28.019047632 +0100 +++ /var/tmp/diff_new_pack.OmVIDb/_new 2019-01-26 22:18:28.023047628 +0100 @@ -21,7 +21,7 @@ %define libopenmpt_modplug libopenmpt_modplug1 %bcond_without mpg123 Name: libopenmpt -Version: 0.4.1 +Version: 0.4.2 Release: 0 Summary: C++ and C library to decode tracker music files License: BSD-3-Clause ++++++ libopenmpt-0.4.1+release.autotools.tar.gz -> libopenmpt-0.4.2+release.autotools.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.4.1+release.autotools/common/mptCPU.cpp new/libopenmpt-0.4.2+release.autotools/common/mptCPU.cpp --- old/libopenmpt-0.4.1+release.autotools/common/mptCPU.cpp 2018-10-20 14:39:23.000000000 +0200 +++ new/libopenmpt-0.4.2+release.autotools/common/mptCPU.cpp 2019-01-11 17:35:33.000000000 +0100 @@ -114,21 +114,6 @@ #endif -static std::string ReadBrand(cpuid_result VendorString) -{ - std::string result; - if(VendorString.as_string() == "GenuineIntel") - { - cpuid_result ExtendedVendorString = cpuid(0x80000000u); - if(ExtendedVendorString.a >= 0x80000004u) - { - result = cpuid(0x80000002u).as_string4() + cpuid(0x80000003u).as_string4() + cpuid(0x80000004u).as_string4(); - } - } - return result; -} - - void InitProcSupport() { @@ -295,7 +280,10 @@ if(ExtendedFeatureFlags.d & (1<<31)) ProcSupport |= PROCSUPPORT_AMD_3DNOW; if(ExtendedFeatureFlags.d & (1<<30)) ProcSupport |= PROCSUPPORT_AMD_3DNOWEXT; } - mpt::String::WriteAutoBuf(ProcBrandID) = ReadBrand(VendorString); + if(ExtendedVendorString.a >= 0x80000004u) + { + mpt::String::WriteAutoBuf(ProcBrandID) = cpuid(0x80000002u).as_string4() + cpuid(0x80000003u).as_string4() + cpuid(0x80000004u).as_string4(); + } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.4.1+release.autotools/common/versionNumber.h new/libopenmpt-0.4.2+release.autotools/common/versionNumber.h --- old/libopenmpt-0.4.1+release.autotools/common/versionNumber.h 2019-01-06 13:32:17.000000000 +0100 +++ new/libopenmpt-0.4.2+release.autotools/common/versionNumber.h 2019-01-22 09:55:15.000000000 +0100 @@ -21,7 +21,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 28 #define VER_MINOR 02 -#define VER_MINORMINOR 00 +#define VER_MINORMINOR 04 //Numerical value of the version. #define MPT_VERSION_CURRENT MAKE_VERSION_NUMERIC(VER_MAJORMAJOR,VER_MAJOR,VER_MINOR,VER_MINORMINOR) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.4.1+release.autotools/configure new/libopenmpt-0.4.2+release.autotools/configure --- old/libopenmpt-0.4.1+release.autotools/configure 2019-01-06 14:12:17.000000000 +0100 +++ new/libopenmpt-0.4.2+release.autotools/configure 2019-01-22 10:21:20.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libopenmpt 0.4.1+release.autotools. +# Generated by GNU Autoconf 2.69 for libopenmpt 0.4.2+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.4.1+release.autotools' -PACKAGE_STRING='libopenmpt 0.4.1+release.autotools' +PACKAGE_VERSION='0.4.2+release.autotools' +PACKAGE_STRING='libopenmpt 0.4.2+release.autotools' PACKAGE_BUGREPORT='https://bugs.openmpt.org/' PACKAGE_URL='https://lib.openmpt.org/' @@ -1485,7 +1485,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.4.1+release.autotools to adapt to many kinds of systems. +\`configure' configures libopenmpt 0.4.2+release.autotools to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1556,7 +1556,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libopenmpt 0.4.1+release.autotools:";; + short | recursive ) echo "Configuration of libopenmpt 0.4.2+release.autotools:";; esac cat <<\_ACEOF @@ -1756,7 +1756,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libopenmpt configure 0.4.1+release.autotools +libopenmpt configure 0.4.2+release.autotools generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2246,7 +2246,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.4.1+release.autotools, which was +It was created by libopenmpt $as_me 0.4.2+release.autotools, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3117,7 +3117,7 @@ # Define the identity of the package. PACKAGE='libopenmpt' - VERSION='0.4.1+release.autotools' + VERSION='0.4.2+release.autotools' cat >>confdefs.h <<_ACEOF @@ -17281,13 +17281,13 @@ -$as_echo "#define MPT_SVNURL \"https://source.openmpt.org/svn/openmpt/tags/libopenmpt-0.4.1\"" >>confdefs.h +$as_echo "#define MPT_SVNURL \"https://source.openmpt.org/svn/openmpt/tags/libopenmpt-0.4.2\"" >>confdefs.h -$as_echo "#define MPT_SVNVERSION \"11192\"" >>confdefs.h +$as_echo "#define MPT_SVNVERSION \"11243\"" >>confdefs.h -$as_echo "#define MPT_SVNDATE \"2019-01-06T12:50:18.313363Z\"" >>confdefs.h +$as_echo "#define MPT_SVNDATE \"2019-01-22T08:59:00.771884Z\"" >>confdefs.h $as_echo "#define MPT_PACKAGE true" >>confdefs.h @@ -23527,7 +23527,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.4.1+release.autotools, which was +This file was extended by libopenmpt $as_me 0.4.2+release.autotools, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -23594,7 +23594,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.4.1+release.autotools +libopenmpt config.status 0.4.2+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.4.1+release.autotools/configure.ac new/libopenmpt-0.4.2+release.autotools/configure.ac --- old/libopenmpt-0.4.1+release.autotools/configure.ac 2019-01-06 14:12:08.000000000 +0100 +++ new/libopenmpt-0.4.2+release.autotools/configure.ac 2019-01-22 10:21:10.000000000 +0100 @@ -1,4 +1,4 @@ -AC_INIT([libopenmpt], [0.4.1+release.autotools], [https://bugs.openmpt.org/], [libopenmpt], [https://lib.openmpt.org/]) +AC_INIT([libopenmpt], [0.4.2+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.4.1"], [svn version]) -AC_DEFINE([MPT_SVNVERSION], ["11192"], [svn version]) -AC_DEFINE([MPT_SVNDATE], ["2019-01-06T12:50:18.313363Z"], [svn date]) +AC_DEFINE([MPT_SVNURL], ["https://source.openmpt.org/svn/openmpt/tags/libopenmpt-0.4.2"], [svn version]) +AC_DEFINE([MPT_SVNVERSION], ["11243"], [svn version]) +AC_DEFINE([MPT_SVNDATE], ["2019-01-22T08:59:00.771884Z"], [svn date]) AC_DEFINE([MPT_PACKAGE], [true], [is package]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.4.1+release.autotools/libopenmpt/dox/changelog.md new/libopenmpt-0.4.2+release.autotools/libopenmpt/dox/changelog.md --- old/libopenmpt-0.4.1+release.autotools/libopenmpt/dox/changelog.md 2019-01-06 13:50:15.000000000 +0100 +++ new/libopenmpt-0.4.2+release.autotools/libopenmpt/dox/changelog.md 2019-01-22 09:58:58.000000000 +0100 @@ -5,6 +5,15 @@ For fully detailed change log, please see the source repository directly. This is just a high-level summary. +### libopenmpt 0.4.2 (2019-01-22) + + * [**Sec**] DSM: Assertion failure during file parsing with debug STLs + (r11209). + * [**Sec**] J2B: Assertion failure during file parsing with debug STLs + (r11216). + + * S3M: Allow volume change of OPL instruments after Note Cut. + ### libopenmpt 0.4.1 (2019-01-06) * [**Bug**] Binaries compiled for winold (Windows XP, Vista, 7, for CPUs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.4.1+release.autotools/libopenmpt/libopenmpt_version.h new/libopenmpt-0.4.2+release.autotools/libopenmpt/libopenmpt_version.h --- old/libopenmpt-0.4.1+release.autotools/libopenmpt/libopenmpt_version.h 2019-01-06 13:50:15.000000000 +0100 +++ new/libopenmpt-0.4.2+release.autotools/libopenmpt/libopenmpt_version.h 2019-01-22 09:58:58.000000000 +0100 @@ -19,7 +19,7 @@ /*! \brief libopenmpt minor version number */ #define OPENMPT_API_VERSION_MINOR 4 /*! \brief libopenmpt patch version number */ -#define OPENMPT_API_VERSION_PATCH 1 +#define OPENMPT_API_VERSION_PATCH 2 /*! \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.4.1+release.autotools/libopenmpt/libopenmpt_version.mk new/libopenmpt-0.4.2+release.autotools/libopenmpt/libopenmpt_version.mk --- old/libopenmpt-0.4.1+release.autotools/libopenmpt/libopenmpt_version.mk 2019-01-06 13:50:15.000000000 +0100 +++ new/libopenmpt-0.4.2+release.autotools/libopenmpt/libopenmpt_version.mk 2019-01-22 09:58:58.000000000 +0100 @@ -1,8 +1,8 @@ LIBOPENMPT_VERSION_MAJOR=0 LIBOPENMPT_VERSION_MINOR=4 -LIBOPENMPT_VERSION_PATCH=1 +LIBOPENMPT_VERSION_PATCH=2 LIBOPENMPT_VERSION_PREREL= LIBOPENMPT_LTVER_CURRENT=1 -LIBOPENMPT_LTVER_REVISION=1 +LIBOPENMPT_LTVER_REVISION=2 LIBOPENMPT_LTVER_AGE=1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.4.1+release.autotools/man/openmpt123.1 new/libopenmpt-0.4.2+release.autotools/man/openmpt123.1 --- old/libopenmpt-0.4.1+release.autotools/man/openmpt123.1 2019-01-06 14:12:08.000000000 +0100 +++ new/libopenmpt-0.4.2+release.autotools/man/openmpt123.1 2019-01-22 10:21:10.000000000 +0100 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.4. -.TH OPENMPT123 "1" "January 2019" "openmpt123 v0.4.1" "User Commands" +.TH OPENMPT123 "1" "January 2019" "openmpt123 v0.4.2" "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.4.1+release.autotools/soundlib/Load_dsm.cpp new/libopenmpt-0.4.2+release.autotools/soundlib/Load_dsm.cpp --- old/libopenmpt-0.4.1+release.autotools/soundlib/Load_dsm.cpp 2018-12-06 15:29:05.000000000 +0100 +++ new/libopenmpt-0.4.2+release.autotools/soundlib/Load_dsm.cpp 2019-01-17 22:08:44.000000000 +0100 @@ -257,19 +257,17 @@ ModCommand dummy = ModCommand::Empty(); ROWINDEX row = 0; - PatternRow rowBase = Patterns[patNum].GetRow(0); while(chunk.CanRead(1) && row < 64) { uint8 flag = chunk.ReadUint8(); if(!flag) { row++; - rowBase = Patterns[patNum].GetRow(row); continue; } CHANNELINDEX chn = (flag & 0x0F); - ModCommand &m = (chn < GetNumChannels() ? rowBase[chn] : dummy); + ModCommand &m = (chn < GetNumChannels() ? *Patterns[patNum].GetpModCommand(row, chn) : dummy); if(flag & 0x80) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.4.1+release.autotools/soundlib/Snd_defs.h new/libopenmpt-0.4.2+release.autotools/soundlib/Snd_defs.h --- old/libopenmpt-0.4.1+release.autotools/soundlib/Snd_defs.h 2018-12-21 14:11:03.000000000 +0100 +++ new/libopenmpt-0.4.2+release.autotools/soundlib/Snd_defs.h 2019-01-20 20:23:09.000000000 +0100 @@ -512,6 +512,7 @@ kST3OffsetWithoutInstrument, // Note without instrument uses same offset as previous note kReleaseNodePastSustainBug, // OpenMPT 1.23.01.02 / r4009 broke release nodes past the sustain point, fixed in OpenMPT 1.28 kFT2NoteDelayWithoutInstr, // Sometime between OpenMPT 1.18.03.00 and 1.19.01.00, delayed instrument-less notes in XM started recalling the default sample volume and panning + kOPLFlexibleNoteOff, // Full control after note-off over OPL voices, ^^^ sends note cut instead of just note-off // Add new play behaviours here. @@ -540,13 +541,12 @@ typedef uint64 unsigned_value_t; protected: - value_t v; + value_t v = 0; public: enum : uint32 { fractMax = 0xFFFFFFFFu }; - static MPT_FORCEINLINE uint32 GetFractMax() { return fractMax; } - SamplePosition() : v(0) { } + SamplePosition() { } explicit SamplePosition(value_t pos) : v(pos) { } SamplePosition(int32 intPart, uint32 fractPart) : v((static_cast<value_t>(intPart) * (1ll<<32)) | fractPart) { } static SamplePosition Ratio(uint32 dividend, uint32 divisor) { return SamplePosition((static_cast<int64>(dividend) << 32) / divisor); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.4.1+release.autotools/soundlib/Snd_fx.cpp new/libopenmpt-0.4.2+release.autotools/soundlib/Snd_fx.cpp --- old/libopenmpt-0.4.1+release.autotools/soundlib/Snd_fx.cpp 2018-12-16 23:16:51.000000000 +0100 +++ new/libopenmpt-0.4.2+release.autotools/soundlib/Snd_fx.cpp 2019-01-20 20:23:09.000000000 +0100 @@ -1703,12 +1703,20 @@ // Note Cut if (note == NOTE_NOTECUT) { - chn.dwFlags.set(CHN_NOTEFADE | CHN_FASTVOLRAMP); - // IT compatibility: Stopping sample playback by setting sample increment to 0 rather than volume - // Test case: NoteOffInstr.it - if ((!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT))) || (m_nInstruments != 0 && !m_playBehaviour[kITInstrWithNoteOff])) chn.nVolume = 0; - if(m_playBehaviour[kITInstrWithNoteOff]) chn.increment.Set(0); - chn.nFadeOutVol = 0; + if(chn.dwFlags[CHN_ADLIB] && GetType() == MOD_TYPE_S3M) + { + // OPL voices are not cut but enter the release portion of their envelope + // In S3M we can still modify the volume after note-off, in legacy MPTM mode we can't + chn.dwFlags.set(CHN_KEYOFF); + } else + { + chn.dwFlags.set(CHN_NOTEFADE | CHN_FASTVOLRAMP); + // IT compatibility: Stopping sample playback by setting sample increment to 0 rather than volume + // Test case: NoteOffInstr.it + if ((!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT))) || (m_nInstruments != 0 && !m_playBehaviour[kITInstrWithNoteOff])) chn.nVolume = 0; + if (m_playBehaviour[kITInstrWithNoteOff]) chn.increment.Set(0); + chn.nFadeOutVol = 0; + } } // IT compatibility tentative fix: Clear channel note memory. @@ -2852,9 +2860,9 @@ } } // New Note ? - if (note) + if (note != NOTE_NONE) { - const bool instrChange = (!instr) && (chn.nNewIns) && (note < 0x80); + const bool instrChange = (!instr) && (chn.nNewIns) && ModCommand::IsNote(note); if(instrChange) { InstrumentChange(chn, chn.nNewIns, bPorta, chn.pModSample == nullptr && chn.pModInstrument == nullptr, !(GetType() & (MOD_TYPE_XM|MOD_TYPE_MT2))); @@ -2873,8 +2881,11 @@ chn.nAutoVibDepth = 0; chn.nAutoVibPos = 0; } - if(chn.dwFlags[CHN_ADLIB] && (note == NOTE_NOTECUT || note == NOTE_FADE || note == NOTE_KEYOFF) && m_opl) + if(chn.dwFlags[CHN_ADLIB] && m_opl + && ((note == NOTE_NOTECUT || note == NOTE_KEYOFF) || (note == NOTE_FADE && !m_playBehaviour[kOPLFlexibleNoteOff]))) + { m_opl->NoteOff(nChn); + } } // Tick-0 only volume commands if (volcmd == VOLCMD_VOLUME) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.4.1+release.autotools/soundlib/Sndfile.cpp new/libopenmpt-0.4.2+release.autotools/soundlib/Sndfile.cpp --- old/libopenmpt-0.4.1+release.autotools/soundlib/Sndfile.cpp 2018-12-22 10:21:40.000000000 +0100 +++ new/libopenmpt-0.4.2+release.autotools/soundlib/Sndfile.cpp 2019-01-20 20:23:09.000000000 +0100 @@ -1038,6 +1038,10 @@ playBehaviour.set(kITInstrWithNoteOff); playBehaviour.set(kITMultiSampleInstrumentNumber); playBehaviour.set(kRowDelayWithNoteDelay); + if(type == MOD_TYPE_MPT) + { + playBehaviour.set(kOPLFlexibleNoteOff); + } break; case MOD_TYPE_XM: @@ -1148,6 +1152,7 @@ playBehaviour.set(kITPanbrelloHold); playBehaviour.set(kITPanningReset); playBehaviour.set(kITInstrWithNoteOff); + playBehaviour.set(kOPLFlexibleNoteOff); break; case MOD_TYPE_XM: @@ -1543,19 +1548,19 @@ #ifdef MODPLUG_TRACKER -void CSoundFile::ChangeModTypeTo(const MODTYPE& newType) +void CSoundFile::ChangeModTypeTo(const MODTYPE newType) { - const MODTYPE oldtype = GetType(); + const MODTYPE oldType = GetType(); m_nType = newType; SetModSpecsPointer(m_pModSpecs, m_nType); - if(oldtype == newType) + if(oldType == newType) return; SetupMODPanning(); // Setup LRRL panning scheme if needed // Only keep supported play behaviour flags - PlayBehaviourSet oldAllowedFlags = GetSupportedPlaybackBehaviour(oldtype); + PlayBehaviourSet oldAllowedFlags = GetSupportedPlaybackBehaviour(oldType); PlayBehaviourSet newAllowedFlags = GetSupportedPlaybackBehaviour(newType); PlayBehaviourSet newDefaultFlags = GetDefaultPlaybackBehaviour(newType); for(size_t i = 0; i < m_playBehaviour.size(); i++) @@ -1565,9 +1570,12 @@ // Set allowed flags to their defaults if they were not supported in the old format if(!oldAllowedFlags[i]) m_playBehaviour.set(i, newDefaultFlags[i]); } + // Special case for OPL behaviour when converting from S3M to MPTM to retain S3M-like note-off behaviour + if(oldType == MOD_TYPE_S3M && newType == MOD_TYPE_MPT && m_opl) + m_playBehaviour.reset(kOPLFlexibleNoteOff); - Order.OnModTypeChanged(oldtype); - Patterns.OnModTypeChanged(oldtype); + Order.OnModTypeChanged(oldType); + Patterns.OnModTypeChanged(oldType); m_modFormat.type = mpt::ToUnicode(mpt::CharsetUTF8, GetModSpecifications().fileExtension); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.4.1+release.autotools/soundlib/Sndfile.h new/libopenmpt-0.4.2+release.autotools/soundlib/Sndfile.h --- old/libopenmpt-0.4.1+release.autotools/soundlib/Sndfile.h 2018-12-22 01:49:57.000000000 +0100 +++ new/libopenmpt-0.4.2+release.autotools/soundlib/Sndfile.h 2019-01-20 20:23:09.000000000 +0100 @@ -300,7 +300,7 @@ public: #ifdef MODPLUG_TRACKER - void ChangeModTypeTo(const MODTYPE& newType); + void ChangeModTypeTo(const MODTYPE newType); #endif // MODPLUG_TRACKER // Returns value in seconds. If given position won't be played at all, returns -1. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.4.1+release.autotools/soundlib/Sndmix.cpp new/libopenmpt-0.4.2+release.autotools/soundlib/Sndmix.cpp --- old/libopenmpt-0.4.1+release.autotools/soundlib/Sndmix.cpp 2019-01-02 00:40:00.000000000 +0100 +++ new/libopenmpt-0.4.2+release.autotools/soundlib/Sndmix.cpp 2019-01-20 20:23:09.000000000 +0100 @@ -2235,16 +2235,24 @@ period = m_nMinPeriod; } - if((chn.dwFlags & (CHN_ADLIB | CHN_NOTEFADE | CHN_MUTE | CHN_SYNCMUTE)) == CHN_ADLIB && !chn.pModSample->uFlags[CHN_MUTE] && m_opl) + if((chn.dwFlags & (CHN_ADLIB | CHN_MUTE | CHN_SYNCMUTE)) == CHN_ADLIB && !chn.pModSample->uFlags[CHN_MUTE] && m_opl) { - // In ST3, a sample rate of 8363 Hz is mapped to middle-C, which is 261.625 Hz in a tempered scale at A4 = 440. - // Hence, we have to translate our "sample rate" into pitch. - auto freq = GetFreqFromPeriod(period, chn.nC5Speed, nPeriodFrac); - auto oplmilliHertz = Util::muldivr_unsigned(freq, 261625, 8363 << FREQ_FRACBITS); - m_opl->Frequency(nChn, oplmilliHertz, chn.dwFlags[CHN_KEYOFF], m_playBehaviour[kOPLBeatingOscillators]); - // Scale volume to OPL range (0...63). - m_opl->Volume(nChn, static_cast<uint8>(Util::muldivr_unsigned(chn.nCalcVolume * chn.nGlobalVol * chn.nInsVol, 63, 1 << 26)), false); - chn.nRealPan = m_opl->Pan(nChn, chn.nRealPan) * 128 + 128; + const bool doProcess = m_playBehaviour[kOPLFlexibleNoteOff] || !chn.dwFlags[CHN_NOTEFADE] || GetType() == MOD_TYPE_S3M; + if(doProcess && !(GetType() == MOD_TYPE_S3M && chn.dwFlags[CHN_KEYOFF])) + { + // In ST3, a sample rate of 8363 Hz is mapped to middle-C, which is 261.625 Hz in a tempered scale at A4 = 440. + // Hence, we have to translate our "sample rate" into pitch. + const auto freq = GetFreqFromPeriod(period, chn.nC5Speed, nPeriodFrac); + const auto oplmilliHertz = Util::muldivr_unsigned(freq, 261625, 8363 << FREQ_FRACBITS); + const bool keyOff = chn.dwFlags[CHN_KEYOFF] || (chn.dwFlags[CHN_NOTEFADE] && chn.nFadeOutVol == 0); + m_opl->Frequency(nChn, oplmilliHertz, keyOff, m_playBehaviour[kOPLBeatingOscillators]); + } + if(doProcess) + { + // Scale volume to OPL range (0...63). + m_opl->Volume(nChn, static_cast<uint8>(Util::muldivr_unsigned(chn.nCalcVolume * chn.nGlobalVol * chn.nInsVol, 63, 1 << 26)), false); + chn.nRealPan = m_opl->Pan(nChn, chn.nRealPan) * 128 + 128; + } // Deallocate OPL channels for notes that are most definitely never going to play again. const auto *ins = chn.pModInstrument; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.4.1+release.autotools/soundlib/load_j2b.cpp new/libopenmpt-0.4.2+release.autotools/soundlib/load_j2b.cpp --- old/libopenmpt-0.4.1+release.autotools/soundlib/load_j2b.cpp 2018-12-21 14:11:03.000000000 +0100 +++ new/libopenmpt-0.4.2+release.autotools/soundlib/load_j2b.cpp 2019-01-19 11:21:41.000000000 +0100 @@ -504,7 +504,6 @@ if(channels == 0) return false; - PatternRow rowBase = sndFile.Patterns[pat].GetRow(0); ROWINDEX row = 0; while(row < numRows && chunk.CanRead(1)) @@ -514,11 +513,10 @@ if(flags == rowDone) { row++; - rowBase = sndFile.Patterns[pat].GetRow(row); continue; } - ModCommand &m = rowBase[std::min<CHANNELINDEX>((flags & channelMask), channels - 1)]; + ModCommand &m = *sndFile.Patterns[pat].GetpModCommand(row, std::min<CHANNELINDEX>((flags & channelMask), channels - 1)); if(flags & dataFlag) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libopenmpt-0.4.1+release.autotools/test/test.cpp new/libopenmpt-0.4.2+release.autotools/test/test.cpp --- old/libopenmpt-0.4.1+release.autotools/test/test.cpp 2018-12-22 11:22:35.000000000 +0100 +++ new/libopenmpt-0.4.2+release.autotools/test/test.cpp 2019-01-19 23:34:55.000000000 +0100 @@ -2022,7 +2022,7 @@ VERIFY_EQUAL(SamplePosition(-1).IsNegative(), true); VERIFY_EQUAL(SamplePosition(int64_max).GetRaw(), int64_max); VERIFY_EQUAL(SamplePosition(2, SamplePosition::fractMax).GetInt(), 2); - VERIFY_EQUAL(SamplePosition(2, SamplePosition::fractMax).GetFract(), SamplePosition::GetFractMax()); + VERIFY_EQUAL(SamplePosition(2, SamplePosition::fractMax).GetFract(), SamplePosition::fractMax); VERIFY_EQUAL(SamplePosition(1, SamplePosition::fractMax).GetInvertedFract(), SamplePosition(0, 1)); VERIFY_EQUAL(SamplePosition(1, 0).GetInvertedFract(), SamplePosition(1, 0)); VERIFY_EQUAL(SamplePosition(2, 0).Negate(), SamplePosition(-2, 0));