summaryrefslogtreecommitdiffstats
path: root/audio/filter/af.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-10 23:39:29 +0100
committerwm4 <wm4@nowhere>2013-11-12 23:34:35 +0100
commit824e6550f8ef1f361701eae469ada35d3889ab83 (patch)
tree7170184cfcdce814fde9308941fd2b4ff74d126c /audio/filter/af.h
parent7510caa0c5ef3db320d1065f869d14c0eddecf79 (diff)
downloadmpv-824e6550f8ef1f361701eae469ada35d3889ab83.tar.bz2
mpv-824e6550f8ef1f361701eae469ada35d3889ab83.tar.xz
audio/filter: fix mul/delay scale and values
Before this commit, the af_instance->mul/delay values were in bytes. Using bytes is confusing for non-interleaved audio, so switch mul to samples, and delay to seconds. For delay, seconds are more intuitive than bytes or samples, because it's used for the latency calculation. We also might want to replace the delay mechanism with real PTS tracking inside the filter chain some time in the future, and PTS will also require time-adjustments to be done in seconds. For most filters, we just remove the redundant mul=1 initialization. (Setting this used to be required, but not anymore.)
Diffstat (limited to 'audio/filter/af.h')
-rw-r--r--audio/filter/af.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/audio/filter/af.h b/audio/filter/af.h
index 36c2cf33fd..7852fa09a6 100644
--- a/audio/filter/af.h
+++ b/audio/filter/af.h
@@ -64,10 +64,11 @@ struct af_instance {
struct mp_audio *data; // configuration and buffer for outgoing data stream
struct af_instance *next;
struct af_instance *prev;
- double delay; /* Delay caused by the filter, in units of bytes read without
- * corresponding output */
+ double delay; /* Delay caused by the filter, in seconds of audio consumed
+ * without corresponding output */
double mul; /* length multiplier: how much does this instance change
- the length of the buffer. */
+ * the number of samples passed though. (Ratio of input
+ * and output, e.g. mul=4 => 1 sample becomes 4 samples) .*/
bool auto_inserted; // inserted by af.c, such as conversion filters
};