summaryrefslogtreecommitdiffstats
path: root/libaf/af.c
diff options
context:
space:
mode:
authoranders <anders@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-10-08 10:20:36 +0000
committeranders <anders@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-10-08 10:20:36 +0000
commit3e3a4733fbd6655c1fd81c64cf46fb64fd7ed736 (patch)
tree41186a2df2c7e4034df5ec95abc176a602733230 /libaf/af.c
parentf767a62a4291dd41ff68fe8e6277f24443ff827d (diff)
downloadmpv-3e3a4733fbd6655c1fd81c64cf46fb64fd7ed736.tar.bz2
mpv-3e3a4733fbd6655c1fd81c64cf46fb64fd7ed736.tar.xz
Adding function for calculating the delay caused by the filters
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7666 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libaf/af.c')
-rw-r--r--libaf/af.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libaf/af.c b/libaf/af.c
index e4d496464d..14b06624cd 100644
--- a/libaf/af.c
+++ b/libaf/af.c
@@ -487,6 +487,19 @@ int af_calc_insize_constrained(af_stream_t* s, int len,
return in;
}
+/* Calculate the total delay [ms] caused by the filters */
+double af_calc_delay(af_stream_t* s)
+{
+ af_instance_t* af=s->first;
+ register double delay = 0.0;
+ // Iterate through all filters
+ while(af){
+ delay += af->delay;
+ af=af->next;
+ }
+ return delay;
+}
+
/* Helper function called by the macro with the same name this
function should not be called directly */
inline int af_resize_local_buffer(af_instance_t* af, af_data_t* data)