Skip to content
Snippets Groups Projects
Commit 049885a2 authored by Thomas Guillem's avatar Thomas Guillem Committed by Steve Lhomme
Browse files

aout: dec: don't require a valid time_get cb

Refs #27023
parent 53d8690a
No related branches found
No related tags found
1 merge request!2018clock: fix audio/video synchronisation issues
......@@ -181,7 +181,7 @@ struct audio_output
*/
int (*time_get)(audio_output_t *, vlc_tick_t *delay);
/**< Estimates playback buffer latency (mandatory, cannot be NULL).
/**< Estimates playback buffer latency (can 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
......@@ -189,10 +189,9 @@ struct 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. vlc_tick_now()), then aout_TimeGetDefault() can
* implement this callback. In that case, drain must be implemented (since
* the default implementation uses the delay to wait for the end of the
* stream).
* monotonic clock (i.e. vlc_tick_now()), then this callback is not
* mandatory. In that case, drain must be implemented (since the default
* implementation uses the delay to wait for the end of the stream).
*
* This callback is called before the first play() in order to get the
* initial delay (the hw latency). Most modules won't be able to know this
......
......@@ -101,6 +101,8 @@ static inline struct vlc_tracer *aout_stream_tracer(vlc_aout_stream *stream)
static int aout_TimeGet(audio_output_t *aout, vlc_tick_t *delay)
{
if (aout->time_get == NULL)
return -1;
return aout->time_get(aout, delay);
}
......
......@@ -772,7 +772,7 @@ int aout_OutputNew(audio_output_t *aout, vlc_aout_stream *stream,
"failing back to linear format");
return -1;
}
assert(aout->flush && aout->play && aout->time_get && aout->pause);
assert(aout->flush && aout->play && aout->pause);
/* Autoselect the headphones mode if available and if the user didn't
* request any mode */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment