SLresult is defined as an SLuint32 and might not be represented as an
unsigned long int. It is raising warnings when compiling for android
aarch64, so cast it to ensure it's an uint32_t and display it with
PRIu32 instead.
block_t->i_buffer is size_t too and must be displayed with %zu.
This callback is not mandatory. If it is NULL, the core will wait for the delay
returned by time_get(). This was already the case for most aout plugins:
PulseAudio, coreaudio, Android, DirectSound, Wasapi, and Jack.
Do not declare *_sys_t typedefs globally in vlc_common.h. Instead,
declare them locally in each module that provides a definition.
This paves the way to move C++ definitions into anonymous namespaces in
order to respect C++ ODR.
The picture_resource_t and sout_stream_id_sys_t typedefs will be handled
separately, since they require specific additional changes.
See #18033
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Audio outputs don't need the channel mask for S/PDIF or HDMI passthrough.
This will be convenient for Dolby Atmos that can have a higher channel count
that can't be mapped.
If resampling from a higher sampling rate to a lower, one will
end up with noises in the audio due to an android bug.
Signed-off-by: Rafaël Carré <funman@videolan.org>
This rounds up to exactly 441 samples with 44.1kHz audio
This avoids a rounding error in drift calculation of 2.31 milliseconds
in the worst case of the buffers queue being full for the specific
case of 44.1kHz audio (such a small error is not significative).
For unknown reasons it also fixes A/V sync issues.
We only considered the audio already buffered through opensles engine,
so the calculation was incorrect.
Use samples rather than bytes for calculation, and a function rather than
hardcoding 2*2 all over the place when a size in bytes is needed.
Now audio codec frame size will not affect latency precision, at the
small cost of one memcpy per frame.
With the maximum number of OpenSLES buffers (255), we can have a precision
of 4ms with a buffer size of ~1 second.