[vlc-devel] [RFC PATCH 2/2] alsa: implement non-blocking play()
Rémi Denis-Courmont
remi at remlab.net
Tue Mar 12 18:48:43 CET 2019
Le tiistaina 12. maaliskuuta 2019, 19.18.43 EET Thomas Guillem a écrit :
> ---
> modules/audio_output/alsa.c | 16 ++++++++++------
> 1 file changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/modules/audio_output/alsa.c b/modules/audio_output/alsa.c
> index 5d30d05af9..5c44df4a6e 100644
> --- a/modules/audio_output/alsa.c
> +++ b/modules/audio_output/alsa.c
> @@ -47,6 +47,7 @@ typedef struct
> vlc_fourcc_t format; /**< Sample format */
> uint8_t chans_table[AOUT_CHAN_MAX]; /**< Channels order table */
> uint8_t chans_to_reorder; /**< Number of channels to reorder */
> + vlc_tick_t buffer_len;
>
> bool soft_mute;
> float soft_gain;
> @@ -411,7 +412,7 @@ static int Start (audio_output_t *aout,
> audio_sample_format_t *restrict fmt) /* Open the device */
> snd_pcm_t *pcm;
> /* VLC always has a resampler. No need for ALSA's. */
> - const int mode = SND_PCM_NO_AUTO_RESAMPLE;
> + const int mode = SND_PCM_NO_AUTO_RESAMPLE | SND_PCM_NONBLOCK;
That's meant to be used with an I/O event loop; the code is even in old VLC
versions - or in the ALSA input module.
--
レミ・デニ-クールモン
http://www.remlab.net/
More information about the vlc-devel
mailing list