eric_wong - 2013-10-10

v2 of the patch. v1 had a leak, here is the diff between v1 and v2
(full v2 attached as 0002-...)

--- a/src/ladspa.c
+++ b/src/ladspa.c
@@ -407,7 +407,8 @@ static int sox_ladspa_flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sa
 }

 /*
- * Nothing to do.
+ * Nothing to do if the plugin has no latency or latency compensation is
+ * disabled.
  */
 static int sox_ladspa_drain(sox_effect_t * effp, sox_sample_t *obuf, size_t *osamp)
 {
@@ -431,6 +432,9 @@ static int sox_ladspa_drain(sox_effect_t * effp, sox_sample_t *obuf, size_t *osa
   *osamp = min(dsamp, *osamp);
   memcpy(obuf, dbuf, *osamp * sizeof(sox_sample_t));

+  free(ibuf);
+  free(dbuf);
+
   return r == SOX_SUCCESS ? SOX_EOF : 0;
 }

The following changes since commit a6be594c819dc408e2f72425b7de2b5c4590c1eb:

add Dolph window for spectrogram effect (2013-05-27 18:35:40 +0100)

are available in the git repository at:

git://bogomips.org/sox ladspa-latency

for you to fetch changes up to af31e5211d445653a17cd557faeccdc32678c0f8:

ladspa: optionally perform latency compensation (2013-10-10 09:32:24 +0000)