summaryrefslogtreecommitdiffstats
path: root/libaf/af.h
diff options
context:
space:
mode:
authoruau <uau@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-11-01 06:52:50 +0000
committeruau <uau@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-11-01 06:52:50 +0000
commitd7f6cb23dec483f538239eb42e21c321713c976e (patch)
treea5a87950b4cdae8d0b4e9a6df202000fd4825615 /libaf/af.h
parentde034ce87fdf632b48563e5764f19d66120550a8 (diff)
downloadmpv-d7f6cb23dec483f538239eb42e21c321713c976e.tar.bz2
mpv-d7f6cb23dec483f538239eb42e21c321713c976e.tar.xz
A/V sync: take audio filter buffers into account
Substract the delay caused by filter buffering when calculating currently playing audio position. This matters for af_scaletempo which buffers significant and varying amounts of data. For other current filters the effect is normally insignificant. Instead of the old time-based filter delay field (which was ignored) this version stores the per-filter delay in units of bytes input read without corresponding output. This allows the current scaletempo behavior where other filters before and after it can see the same nominal samplerate even though the real duration of the data varies; in this case the other filters can not know the delay they're causing in terms of real time. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24928 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libaf/af.h')
-rw-r--r--libaf/af.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/libaf/af.h b/libaf/af.h
index 4c983cb6e4..a4dc6f9535 100644
--- a/libaf/af.h
+++ b/libaf/af.h
@@ -54,7 +54,8 @@ typedef struct af_instance_s
af_data_t* data; // configuration for outgoing data stream
struct af_instance_s* next;
struct af_instance_s* prev;
- double delay; // Delay caused by the filter [ms]
+ double delay; /* Delay caused by the filter, in units of bytes read without
+ * corresponding output */
double mul; /* length multiplier: how much does this instance change
the length of the buffer. */
}af_instance_t;
@@ -196,7 +197,7 @@ double af_calc_filter_multiplier(af_stream_t* s);
/**
* \brief Calculate the total delay caused by the filters
- * \return delay in seconds
+ * \return delay in bytes of "missing" output
*/
double af_calc_delay(af_stream_t* s);