Browse Source

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

Refs #27023
pull/136/head
Thomas Guillem 4 years ago
committed by Steve Lhomme
parent
commit
049885a232
  1. 9
      include/vlc_aout.h
  2. 2
      src/audio_output/dec.c
  3. 2
      src/audio_output/output.c

9
include/vlc_aout.h

@ -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

2
src/audio_output/dec.c

@ -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);
}

2
src/audio_output/output.c

@ -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 */

Loading…
Cancel
Save