diff options
author | wm4 <wm4@nowhere> | 2013-11-10 23:39:29 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-11-12 23:34:35 +0100 |
commit | 824e6550f8ef1f361701eae469ada35d3889ab83 (patch) | |
tree | 7170184cfcdce814fde9308941fd2b4ff74d126c /mpvcore/player | |
parent | 7510caa0c5ef3db320d1065f869d14c0eddecf79 (diff) | |
download | mpv-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 'mpvcore/player')
-rw-r--r-- | mpvcore/player/audio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mpvcore/player/audio.c b/mpvcore/player/audio.c index fa29778fe9..9bad5140ef 100644 --- a/mpvcore/player/audio.c +++ b/mpvcore/player/audio.c @@ -203,7 +203,7 @@ double written_audio_pts(struct MPContext *mpctx) a_pts -= sh_audio->a_buffer_len / bps; // Data buffered in audio filters, measured in seconds of "missing" output - double buffered_output = af_calc_delay(sh_audio->afilter) / mpctx->ao->bps; + double buffered_output = af_calc_delay(sh_audio->afilter); // Data that was ready for ao but was buffered because ao didn't fully // accept everything to internal buffers yet |