[vlc-commits] FluidSynth: handle discontinuities

Rémi Denis-Courmont git at videolan.org
Thu Jul 10 19:52:00 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jul 10 20:34:53 2014 +0300| [539ce5abec8005028340b2bf3eefacc0308b2dbf] | committer: Rémi Denis-Courmont

FluidSynth: handle discontinuities

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=539ce5abec8005028340b2bf3eefacc0308b2dbf
---

 modules/codec/fluidsynth.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/modules/codec/fluidsynth.c b/modules/codec/fluidsynth.c
index fe065d6..43a91f2 100644
--- a/modules/codec/fluidsynth.c
+++ b/modules/codec/fluidsynth.c
@@ -206,6 +206,16 @@ static block_t *DecodeBlock (decoder_t *p_dec, block_t **pp_block)
         return NULL;
     *pp_block = NULL;
 
+    if (p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED))
+    {
+        date_Set (&p_sys->end_date, 0);
+        //fluid_synth_system_reset (p_sys->synth);
+        fluid_synth_program_reset (p_sys->synth);
+        for (unsigned channel = 0; channel < 16; channel++)
+            for (unsigned note = 0; note < 128; note++)
+                fluid_synth_noteoff (p_sys->synth, channel, note);
+    }
+
     if (p_block->i_pts > VLC_TS_INVALID && !date_Get (&p_sys->end_date))
         date_Set (&p_sys->end_date, p_block->i_pts);
     else



More information about the vlc-commits mailing list