[CM] Snd: region's peak_envs not updated after editing

Tito Latini tito.01beta at gmail.com
Fri Mar 27 11:38:37 PDT 2015


Hello, you can see this bug with the follow steps:

  - make a region, no too short otherwise `peak_env_usable' returns
    "false" and the waveform is correct

  - edit the created region

  - from Regions view, move the slider to right. During the sliding,
    when `peak_env_usable' returns "true" in snd-chn.c:1797, it starts
    to display the old waveform.

The attached patch is a possible solution.
-------------- next part --------------
diff -ur snd-15~/snd-region.c snd-15/snd-region.c
--- snd-15~/snd-region.c	2015-03-27 19:33:23.042250004 +0100
+++ snd-15/snd-region.c	2015-03-27 19:33:29.200172589 +0100
@@ -1246,9 +1246,13 @@
 
   for (i = 0; i < sp->nchans; i++)
     {
+      chan_info *cp;
       mus_float_t val;
       val = channel_maxamp(sp->chans[i], AT_CURRENT_EDIT_POSITION);
       if (val > r->maxamp) r->maxamp = val;
+
+      if ((cp = sp->chans[i]))
+        r->peak_envs[i] = copy_peak_env_info(cp->edits[0]->peak_env, false);
     }
 
   /* make new region temp file */


More information about the Cmdist mailing list