Hello community,

here is the log from the commit of package fluidsynth for openSUSE:Factory 
checked in at 2018-05-08 13:32:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/fluidsynth (Old)
 and      /work/SRC/openSUSE:Factory/.fluidsynth.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "fluidsynth"

Tue May  8 13:32:36 2018 rev:38 rq:604598 version:1.1.11

Changes:
--------
--- /work/SRC/openSUSE:Factory/fluidsynth/fluidsynth.changes    2018-03-09 
10:34:03.481768492 +0100
+++ /work/SRC/openSUSE:Factory/.fluidsynth.new/fluidsynth.changes       
2018-05-08 13:32:37.779751983 +0200
@@ -1,0 +2,14 @@
+Sun May  6 06:55:29 UTC 2018 - [email protected]
+
+- Update to 1.1.11:
+  * fix pkgconfig file for absolute paths
+  * add a cmake option for OSS support
+  * fix broken enable-midishare cmake option
+  * fix double free in fluid_midi_router
+  * prevent malicious soundfonts from causing buffer overflows
+  * avoid SF3 files to be loaded incorrectly
+  * fix an endless loop in fast file renderer
+- remove 0001-Fix-pkgconfig-file-for-absolute-paths-347.patch
+
+
+-------------------------------------------------------------------

Old:
----
  0001-Fix-pkgconfig-file-for-absolute-paths-347.patch
  fluidsynth-1.1.10.tar.gz

New:
----
  fluidsynth-1.1.11.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ fluidsynth.spec ++++++
--- /var/tmp/diff_new_pack.UR6Md5/_old  2018-05-08 13:32:38.355731201 +0200
+++ /var/tmp/diff_new_pack.UR6Md5/_new  2018-05-08 13:32:38.355731201 +0200
@@ -24,7 +24,7 @@
 %endif
 
 Name:           fluidsynth
-Version:        1.1.10
+Version:        1.1.11
 Release:        0
 Summary:        A Real-Time Software Synthesizer That Uses Soundfont(tm)
 License:        LGPL-2.1+
@@ -32,7 +32,6 @@
 Url:            http://www.fluidsynth.org/
 Source:         
https://github.com/FluidSynth/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
 Source1000:     baselibs.conf
-Patch1:         0001-Fix-pkgconfig-file-for-absolute-paths-347.patch
 BuildRequires:  cmake >= 3.0.2
 BuildRequires:  ladspa-devel
 BuildRequires:  pkgconfig
@@ -71,7 +70,6 @@
 
 %prep
 %setup -q
-%patch1 -p1
 
 %build
 %cmake \

++++++ fluidsynth-1.1.10.tar.gz -> fluidsynth-1.1.11.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-1.1.10/CMakeLists.txt 
new/fluidsynth-1.1.11/CMakeLists.txt
--- old/fluidsynth-1.1.10/CMakeLists.txt        2018-02-24 18:32:40.000000000 
+0100
+++ new/fluidsynth-1.1.11/CMakeLists.txt        2018-05-06 09:05:11.000000000 
+0200
@@ -29,7 +29,7 @@
 # FluidSynth package version
 set ( FLUIDSYNTH_VERSION_MAJOR 1 )
 set ( FLUIDSYNTH_VERSION_MINOR 1 )
-set ( FLUIDSYNTH_VERSION_MICRO 10 )
+set ( FLUIDSYNTH_VERSION_MICRO 11 )
 set ( VERSION 
"${FLUIDSYNTH_VERSION_MAJOR}.${FLUIDSYNTH_VERSION_MINOR}.${FLUIDSYNTH_VERSION_MICRO}"
 )
 set ( FLUIDSYNTH_VERSION "\"${VERSION}\"" )
 
@@ -44,30 +44,31 @@
 # This is not exactly the same algorithm as the libtool one, but the results 
are the same.
 set ( LIB_VERSION_CURRENT 1 )
 set ( LIB_VERSION_AGE 7 )
-set ( LIB_VERSION_REVISION 1 )
+set ( LIB_VERSION_REVISION 2 )
 set ( LIB_VERSION_INFO
       "${LIB_VERSION_CURRENT}.${LIB_VERSION_AGE}.${LIB_VERSION_REVISION}" )
 
 # Options disabled by default
+option ( enable-debug "enable debugging (default=no)" off )
 option ( enable-floats "enable type float instead of double for DSP samples" 
off )
 option ( enable-profiling "profile the dsp code" off )
 option ( enable-ladspa "enable LADSPA effect units" off )
+option ( enable-fpe-check "enable Floating Point Exception checks and debug 
messages" off )
 option ( enable-portaudio "compile PortAudio support" off )
 option ( enable-trap-on-fpe "enable SIGFPE trap on Floating Point Exceptions" 
off )
-option ( enable-fpe-check "enable Floating Point Exception checks and debug 
messages" off )
-option ( enable-debug "enable debugging (default=no)" off )
 
 # Options enabled by default
-option ( enable-pkgconfig "use pkg-config to locate fluidsynth's (mostly 
optional) dependencies" on )
-option ( enable-libsndfile "compile libsndfile support (if it is available)" 
on )
 option ( enable-aufile "compile support for sound file output" on )
-option ( enable-pulseaudio "compile PulseAudio support (if it is available)" 
on )
+option ( BUILD_SHARED_LIBS "Build a shared object or DLL" on )
+option ( enable-dbus "compile DBUS support (if it is available)" on )
+option ( enable-ipv6  "enable ipv6 support" on )
 option ( enable-jack "compile JACK support (if it is available)" on )
+option ( enable-libsndfile "compile libsndfile support (if it is available)" 
on )
 option ( enable-midishare "compile MidiShare support (if it is available)" on )
+option ( enable-oss "compile OSS support (if it is available)" on )
+option ( enable-pkgconfig "use pkg-config to locate fluidsynth's (mostly 
optional) dependencies" on )
+option ( enable-pulseaudio "compile PulseAudio support (if it is available)" 
on )
 option ( enable-readline "compile readline lib line editing (if it is 
available)" on )
-option ( enable-dbus "compile DBUS support (if it is available)" on )
-option ( BUILD_SHARED_LIBS "Build a shared object or DLL" on )
-option ( enable-ipv6  "enable ipv6 support " on )
 
 # Platform specific options
 if ( CMAKE_SYSTEM MATCHES "Linux" )
@@ -416,16 +417,24 @@
   set ( AUFILE_SUPPORT 1 )
 endif ( enable-aufile )
 
-find_package ( OSS QUIET )
-set ( OSS_SUPPORT ${OSS_FOUND} )
+unset ( OSS_SUPPORT CACHE )
+if ( enable-oss )
+  find_package ( OSS QUIET )
+  set ( OSS_SUPPORT ${OSS_FOUND} )
+endif ( enable-oss )
 
 unset ( MIDISHARE_SUPPORT CACHE )
-if ( enable_midishare )
-  find_package ( MidiShare )
+if ( enable-midishare )
+  find_package ( MidiShare QUIET )
   set ( MIDISHARE_SUPPORT ${MidiShare_FOUND} )
-else ( enable_midishare )
+  if ( MidiShare_FOUND )
+    set ( MidiShare_LIBS ${MidiShare_LIBRARIES} )
+  else ( MidiShare_FOUND )
+    unset ( MidiShare_LIBS CACHE )
+  endif ( MidiShare_FOUND )
+else ( enable-midishare )
   unset ( MidiShare_LIBS CACHE )
-endif ( enable_midishare )
+endif ( enable-midishare )
 
 unset ( WITH_READLINE CACHE )
 if ( enable-readline )
@@ -461,8 +470,16 @@
 # pkg-config support
 set ( prefix "${CMAKE_INSTALL_PREFIX}" )
 set ( exec_prefix "\${prefix}" )
-set ( libdir "\${exec_prefix}/${LIB_INSTALL_DIR}" )
-set ( includedir "\${prefix}/${INCLUDE_INSTALL_DIR}" )
+if ( IS_ABSOLUTE "${LIB_INSTALL_DIR}" )
+  set ( libdir "${LIB_INSTALL_DIR}" )
+else ()
+  set ( libdir "\${exec_prefix}/${LIB_INSTALL_DIR}" )
+endif ()
+if ( IS_ABSOLUTE "${INCLUDE_INSTALL_DIR}" )
+  set ( includedir "${INCLUDE_INSTALL_DIR}" )
+else ()
+  set ( includedir "\${prefix}/${INCLUDE_INSTALL_DIR}" )
+endif ()
 configure_file ( fluidsynth.pc.in
        ${CMAKE_BINARY_DIR}/fluidsynth.pc IMMEDIATE @ONLY )
 install ( FILES ${CMAKE_BINARY_DIR}/fluidsynth.pc
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-1.1.10/cmake_admin/FindMidiShare.cmake 
new/fluidsynth-1.1.11/cmake_admin/FindMidiShare.cmake
--- old/fluidsynth-1.1.10/cmake_admin/FindMidiShare.cmake       2018-02-24 
18:32:40.000000000 +0100
+++ new/fluidsynth-1.1.11/cmake_admin/FindMidiShare.cmake       2018-05-06 
09:05:11.000000000 +0200
@@ -1,18 +1,18 @@
 # Try to find the READLINE library
 #  MidiShare_FOUND - system has MidiShare
 #  MidiShare_INCLUDE_DIR - MidiShare include directory
-#  MidiShare_LIBS - Libraries needed to use MidiShare
+#  MidiShare_LIBRARIES - Libraries needed to use MidiShare
 
-if ( MidiShare_INCLUDE_DIR AND MidiShare_LIBS )
+if ( MidiShare_INCLUDE_DIR AND MidiShare_LIBRARIES )
     set ( MidiShare_FIND_QUIETLY TRUE )
-endif ( MidiShare_INCLUDE_DIR AND MidiShare_LIBS )
+endif ( MidiShare_INCLUDE_DIR AND MidiShare_LIBRARIES )
 
 find_path ( MidiShare_INCLUDE_DIR NAMES MidiShare.h )
-find_library ( MidiShare_LIBS NAMES MidiShare )
+find_library ( MidiShare_LIBRARIES NAMES MidiShare )
 
 include ( FindPackageHandleStandardArgs )
 find_package_handle_standard_args( MidiShare DEFAULT_MSG 
                                    MidiShare_INCLUDE_DIR 
-                                   MidiShare_LIBS )
+                                   MidiShare_LIBRARIES )
 
-mark_as_advanced( MidiShare_INCLUDE_DIR MidiShare_LIBS )
+mark_as_advanced( MidiShare_INCLUDE_DIR MidiShare_LIBRARIES )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-1.1.10/doc/Doxyfile 
new/fluidsynth-1.1.11/doc/Doxyfile
--- old/fluidsynth-1.1.10/doc/Doxyfile  2018-02-24 18:32:40.000000000 +0100
+++ new/fluidsynth-1.1.11/doc/Doxyfile  2018-05-06 09:05:11.000000000 +0200
@@ -5,7 +5,7 @@
 #---------------------------------------------------------------------------
 DOXYFILE_ENCODING = UTF-8
 PROJECT_NAME = libfluidsynth
-PROJECT_NUMBER = 1.1.10
+PROJECT_NUMBER = 1.1.11
 OUTPUT_DIRECTORY = api
 CREATE_SUBDIRS = NO
 OUTPUT_LANGUAGE = English
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-1.1.10/doc/fluidsynth-v11-devdoc.txt 
new/fluidsynth-1.1.11/doc/fluidsynth-v11-devdoc.txt
--- old/fluidsynth-1.1.10/doc/fluidsynth-v11-devdoc.txt 2018-02-24 
18:32:40.000000000 +0100
+++ new/fluidsynth-1.1.11/doc/fluidsynth-v11-devdoc.txt 2018-05-06 
09:05:11.000000000 +0200
@@ -8,8 +8,8 @@
 \author David Henningsson
 \author Tom Moebert
 \author Copyright © 2003-2018 Peter Hanappe, Conrad Berhörster, Antoine 
Schmitt, Pedro López-Cabanillas, Josh Green, David Henningsson, Tom Moebert
-\version Revision 1.1.10
-\date 2018-02-24
+\version Revision 1.1.11
+\date 2018-05-04
 
 All the source code examples in this document are in the public domain; you 
can use them as you please. This document is licensed under the Creative 
Commons Attribution-Share Alike 3.0 Unported License. To view a copy of this 
license, visit http://creativecommons.org/licenses/by-sa/3.0/ . The FluidSynth 
library is distributed under the GNU Lesser General Public License. A copy of 
the GNU Lesser General Public License is contained in the FluidSynth package; 
if not, visit http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt or write to 
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
02110-1301 USA.
 
@@ -40,6 +40,7 @@
 - \ref SendingMIDI
 - \ref RealtimeMIDI
 - \ref MIDIPlayer
+- \ref FileRenderer
 - \ref MIDIPlayerMem
 - \ref MIDIRouter 
 - \ref Sequencer
@@ -1516,6 +1517,60 @@
   </tr>
 </table>
 
+\section FileRenderer Fast file renderer for non-realtime MIDI file rendering
+
+Instead of creating an audio driver as described in section \ref MIDIPlayer 
one may chose to use the file renderer, which is the fastest way to synthesize 
MIDI files.
+
+\code
+fluid_settings_t* settings;
+fluid_synth_t* synth;
+fluid_player_t* player;
+fluid_file_renderer_t* renderer;
+
+settings = new_fluid_settings();
+
+// specify the file to store the audio to
+// make sure you compiled fluidsynth with libsndfile to get a real wave file
+// otherwise this file will only contain raw s16 stereo PCM
+fluid_settings_setstr(settings, "audio.file.name", "/path/to/output.wav");
+
+// use number of samples processed as timing source, rather than the system 
timer
+fluid_settings_setstr(settings, "player.timing-source", "sample");
+
+// since this is a non-realtime szenario, there is no need to pin the sample 
data
+fluid_settings_setint(settings, "synth.lock-memory", 0);
+
+synth = new_fluid_synth(settings);
+
+// *** loading of a soundfont omitted ***
+
+player = new_fluid_player(synth);
+fluid_player_add(player, "/path/to/midifile.mid");
+fluid_player_play(player);
+
+renderer = new_fluid_file_renderer (synth);
+
+while (fluid_player_get_status(player) == FLUID_PLAYER_PLAYING)
+{
+    if (fluid_file_renderer_process_block(renderer) != FLUID_OK)
+    {
+        break;
+    }
+}
+
+// just for sure: stop the playback explicitly and wait until finished
+fluid_player_stop(player);
+fluid_player_join(player);
+
+delete_fluid_file_renderer(renderer);
+delete_fluid_player(player);
+delete_fluid_synth(synth);
+delete_fluid_settings(settings);
+\endcode
+
+Various output files types are supported, if compiled with libsndfile. Those 
can be specified via the \c settings object as well. Refer to the documentation 
of the \c audio.file\.\* options.
+
+
 \section MIDIPlayerMem Playing a MIDI file from memory
 
 FluidSynth can be also play MIDI files directly from a buffer in memory. If 
you need to play a file from a stream (such as stdin, a network, or a 
high-level file interface), you can load the entire file into a buffer first, 
and then use this approach. Use the same technique as above, but rather than 
calling fluid_player_add(), load it into memory and call fluid_player_add_mem() 
instead. Once you have passed a buffer to fluid_player_add_mem(), it is copied, 
so you may use it again or free it immediately (it is your responsibility to 
free it if you allocated it).
@@ -1813,7 +1868,6 @@
 - LADSPA effects unit
 - Multi-channel audio
 - MIDI tunings
-- Fast file renderer for rendering audio to file in non-realtime
 */
 
 /*!
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-1.1.10/doc/fluidsynth.1 
new/fluidsynth-1.1.11/doc/fluidsynth.1
--- old/fluidsynth-1.1.10/doc/fluidsynth.1      2018-02-24 18:32:40.000000000 
+0100
+++ new/fluidsynth-1.1.11/doc/fluidsynth.1      2018-05-06 09:05:11.000000000 
+0200
@@ -13,7 +13,7 @@
 .\" along with this program; see the file LICENSE.  If not, write to
 .\" the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
 .\"
-.TH FluidSynth 1 "Jan 2, 2018"
+.TH FluidSynth 1 "May 5, 2018"
 .\" Please update the above date whenever this man page is modified.
 .\"
 .\" Some roff macros, for reference:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-1.1.10/src/CMakeLists.txt 
new/fluidsynth-1.1.11/src/CMakeLists.txt
--- old/fluidsynth-1.1.10/src/CMakeLists.txt    2018-02-24 18:32:40.000000000 
+0100
+++ new/fluidsynth-1.1.11/src/CMakeLists.txt    2018-05-06 09:05:11.000000000 
+0200
@@ -357,6 +357,7 @@
   install ( TARGETS fluidsynth libfluidsynth
     RUNTIME DESTINATION ${BIN_INSTALL_DIR}
     FRAMEWORK DESTINATION ${FRAMEWORK_INSTALL_DIR}
+    ARCHIVE DESTINATION ${FRAMEWORK_INSTALL_DIR}
 )
 else ( MACOSX_FRAMEWORK )
   install ( TARGETS fluidsynth libfluidsynth
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-1.1.10/src/bindings/fluid_filerenderer.c 
new/fluidsynth-1.1.11/src/bindings/fluid_filerenderer.c
--- old/fluidsynth-1.1.10/src/bindings/fluid_filerenderer.c     2018-02-24 
18:32:40.000000000 +0100
+++ new/fluidsynth-1.1.11/src/bindings/fluid_filerenderer.c     2018-05-06 
09:05:11.000000000 +0200
@@ -380,19 +380,17 @@
 
 #else   /* No libsndfile support */
 
-       int n, offset;
+       size_t res, nmemb = dev->buf_size;
 
        fluid_synth_write_s16(dev->synth, dev->period_size, dev->buf, 0, 2, 
dev->buf, 1, 2);
 
-       for (offset = 0; offset < dev->buf_size; offset += n) {
-
-               n = fwrite((char*) dev->buf + offset, 1, dev->buf_size - 
offset, dev->file);
-               if (n < 0) {
+               res = fwrite(dev->buf, 1, nmemb, dev->file);
+               if (res < nmemb) {
                        FLUID_LOG(FLUID_ERR, "Audio output file write error: 
%s",
                                  strerror (errno));
                        return FLUID_FAILED;
                }
-       }
+
        return FLUID_OK;
 #endif
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-1.1.10/src/fluidsynth.c 
new/fluidsynth-1.1.11/src/fluidsynth.c
--- old/fluidsynth-1.1.10/src/fluidsynth.c      2018-02-24 18:32:40.000000000 
+0100
+++ new/fluidsynth-1.1.11/src/fluidsynth.c      2018-05-06 09:05:11.000000000 
+0200
@@ -844,7 +844,7 @@
 print_welcome()
 {
   printf("FluidSynth runtime version %s\n"
-        "Copyright (C) 2000-2017 Peter Hanappe and others.\n"
+        "Copyright (C) 2000-2018 Peter Hanappe and others.\n"
         "Distributed under the LGPL license.\n"
         "SoundFont(R) is a registered trademark of E-mu Systems, Inc.\n\n",
         fluid_version_str());
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-1.1.10/src/midi/fluid_midi_router.c 
new/fluidsynth-1.1.11/src/midi/fluid_midi_router.c
--- old/fluidsynth-1.1.10/src/midi/fluid_midi_router.c  2018-02-24 
18:32:40.000000000 +0100
+++ new/fluidsynth-1.1.11/src/midi/fluid_midi_router.c  2018-05-06 
09:05:11.000000000 +0200
@@ -179,7 +179,7 @@
     if (!new_rules[i])
     { /* Free already allocated rules */
       for (i2 = 0; i2 < i; i2++)
-        delete_fluid_midi_router_rule (new_rules[i]);
+        delete_fluid_midi_router_rule (new_rules[i2]);
 
       return FLUID_FAILED;
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-1.1.10/src/sfloader/fluid_defsfont.c 
new/fluidsynth-1.1.11/src/sfloader/fluid_defsfont.c
--- old/fluidsynth-1.1.10/src/sfloader/fluid_defsfont.c 2018-02-24 
18:32:40.000000000 +0100
+++ new/fluidsynth-1.1.11/src/sfloader/fluid_defsfont.c 2018-05-06 
09:05:11.000000000 +0200
@@ -2008,6 +2008,7 @@
 /*        FLUID_LOG(FLUID_WARN, "Fixing sample %s: at least 8 data points 
required after loop end", sample->name);     */
 /*        sample->loopend = sample->end - 8; */
 /*      } */
+    sample->valid = TRUE;
   }
   return FLUID_OK;
 }
@@ -3333,12 +3334,39 @@
   int invalid_loops=FALSE;
   int invalid_loopstart;
   int invalid_loopend, loopend_end_mismatch;
-  unsigned int total_samples = sdtachunk_size / 
FLUID_MEMBER_SIZE(fluid_defsfont_t, sampledata[0]);
+  unsigned int total_bytes = sf->samplesize;
+  unsigned int total_samples = total_bytes / 
FLUID_MEMBER_SIZE(fluid_defsfont_t, sampledata[0]);
 
   p = sf->sample;
   while (p)
     {
+      unsigned int max_end;
+
       sam = (SFSample *) (p->data);
+
+      /* Standard SoundFont files (SF2) use sample word indices for sample 
start and end pointers,
+       * but SF3 files with Ogg Vorbis compression use byte indices for start 
and end. */
+      max_end = (sam->sampletype & FLUID_SAMPLETYPE_OGG_VORBIS) ? total_bytes 
: total_samples;
+
+      /* ROM samples are unusable for us by definition, so simply ignore them. 
*/
+      if (sam->sampletype & FLUID_SAMPLETYPE_ROM)
+      {
+        sam->start = sam->end = sam->loopstart = sam->loopend = 0;
+        goto next_sample;
+      }
+
+      /* If end is over the sample data chunk or sam start is greater than 4
+       * less than the end (at least 4 samples).
+       *
+       * FIXME: where does this number 4 come from? And do we need a different 
number for SF3 files?
+       * Maybe we should check for the minimum Ogg Vorbis headers size? */
+      if ((sam->end > max_end) || (sam->start > (sam->end - 4)))
+      {
+        FLUID_LOG (FLUID_WARN, _("Sample '%s' start/end file positions are 
invalid,"
+                   " disabling and will not be saved"), sam->name);
+        sam->start = sam->end = sam->loopstart = sam->loopend = 0;
+        goto next_sample;
+      }
       
       /* The SoundFont 2.4 spec defines the loopstart index as the first 
sample point of the loop */
       invalid_loopstart = (sam->loopstart < sam->start) || (sam->loopstart >= 
sam->loopend);
@@ -3346,25 +3374,12 @@
        * this is as it should be. however we cannot be sure whether any of 
sam.loopend or sam.end
        * is correct. hours of thinking through this have concluded, that it 
would be best practice 
        * to mangle with loops as little as necessary by only making sure 
loopend is within
-       * total_samples. incorrect soundfont shall preferably fail loudly. */
-      invalid_loopend = (sam->loopend > total_samples) || (sam->loopstart >= 
sam->loopend);
+       * max_end. incorrect soundfont shall preferably fail loudly. */
+      invalid_loopend = (sam->loopend > max_end) || (sam->loopstart >= 
sam->loopend);
       
       loopend_end_mismatch = (sam->loopend > sam->end);
-         
-      /* if sample is not a ROM sample and end is over the sample data chunk
-         or sam start is greater than 4 less than the end (at least 4 samples) 
*/
-      if ((!(sam->sampletype & FLUID_SAMPLETYPE_ROM) && sam->end > 
total_samples)
-          || sam->start > (sam->end - 4))
-      {
-          FLUID_LOG (FLUID_WARN, _("Sample '%s' start/end file positions are 
invalid,"
-          " disabling and will not be saved"), sam->name);
-
-               /* disable sample by setting all sample markers to 0 */
-               sam->start = sam->end = sam->loopstart = sam->loopend = 0;
 
-               return (OK);
-           }
-      else if (sam->sampletype & FLUID_SAMPLETYPE_OGG_VORBIS)
+      if (sam->sampletype & FLUID_SAMPLETYPE_OGG_VORBIS)
            {
             /*
              * compressed samples get fixed up after decompression
@@ -3407,6 +3422,7 @@
       sam->loopstart -= sam->start;
       sam->loopend -= sam->start;
 
+next_sample:
       p = fluid_list_next (p);
     }
 
@@ -3418,6 +3434,7 @@
   return (OK);
 }
 
+
 /*=================================sfont.c========================
   Smurf SoundFont Editor
   ================================================================*/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-1.1.10/src/synth/fluid_synth.c 
new/fluidsynth-1.1.11/src/synth/fluid_synth.c
--- old/fluidsynth-1.1.10/src/synth/fluid_synth.c       2018-02-24 
18:32:40.000000000 +0100
+++ new/fluidsynth-1.1.11/src/synth/fluid_synth.c       2018-05-06 
09:05:11.000000000 +0200
@@ -2382,15 +2382,22 @@
 }
 
 /**
- * Get current number of active voices.
+ * @brief Get current number of active voices.
+ *
+ * I.e. the no. of voices that have been
+ * started and have not yet finished. Unless called from synthesis context,
+ * this number does not necessarily have to be equal to the number of voices 
+ * currently processed by the DSP loop, see below.
  * @param synth FluidSynth instance
  * @return Number of currently active voices.
  * @since 1.1.0
  *
  * Note: To generate accurate continuous statistics of the voice count, caller
  * should ensure this function is called synchronously with the audio synthesis
- * process.  This can be done in the new_fluid_audio_driver2() audio callback
- * function for example.
+ * process. This can be done in the new_fluid_audio_driver2() audio callback
+ * function for example. Otherwise every call to this function may return 
different
+ * voice counts as it may change after any (concurrent) call to 
fluid_synth_write_*() made by
+ * e.g. an audio driver or the applications audio rendering thread.
  */
 int
 fluid_synth_get_active_voice_count(fluid_synth_t* synth)


Reply via email to