[vlc-commits] aout: make time_get callback mandatory
Rémi Denis-Courmont
git at videolan.org
Sat May 5 17:07:55 CEST 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat May 5 17:38:17 2018 +0300| [a6c20e0fb97ad41b88d62c253e1aaee167a2ad5a] | committer: Rémi Denis-Courmont
aout: make time_get callback mandatory
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a6c20e0fb97ad41b88d62c253e1aaee167a2ad5a
---
include/vlc_aout.h | 11 ++++++++++-
src/audio_output/dec.c | 3 ---
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/include/vlc_aout.h b/include/vlc_aout.h
index 2f03016986..9363532dc9 100644
--- a/include/vlc_aout.h
+++ b/include/vlc_aout.h
@@ -167,7 +167,16 @@ struct audio_output
*/
int (*time_get)(audio_output_t *, mtime_t *delay);
- /**< Estimates playback buffer latency (optional, may be NULL).
+ /**< Estimates playback buffer latency (mandatory, cannot be NULL).
+ *
+ * This callback computes an estimation of the delay until the current
+ * tail of the audio output buffer would be rendered. This is essential
+ * for (lip) synchronization and long term drift between the audio output
+ * clock and the media upstream clock (if any).
+ *
+ * If the audio output clock is exactly synchronized with the system
+ * monotonic clock (i.e. mdate()), then aout_TimeGetDefault() can
+ * implement this callback.
*
* \param delay pointer to the delay until the next sample to be written
* to the playback buffer is rendered [OUT]
diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c
index 4fce75b2b4..253ea346dd 100644
--- a/src/audio_output/dec.c
+++ b/src/audio_output/dec.c
@@ -231,9 +231,6 @@ static void aout_DecSynchronize(audio_output_t *aout, mtime_t dec_pts)
const float rate = owner->sync.rate;
mtime_t drift;
- if (unlikely(aout->time_get == NULL))
- return;
-
/**
* Depending on the drift between the actual and intended playback times,
* the audio core may ignore the drift, trigger upsampling or downsampling,
More information about the vlc-commits
mailing list