[vlc-commits] aout: audiotrack: handle AUDIO_CHANNELS_TYPE_AMBISONICS
Thomas Guillem
git at videolan.org
Wed Jul 19 18:58:37 CEST 2017
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Jul 19 11:42:22 2017 +0200| [18bdbaee546031f939ad56e7aa5c86e5317d8b1d] | committer: Thomas Guillem
aout: audiotrack: handle AUDIO_CHANNELS_TYPE_AMBISONICS
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=18bdbaee546031f939ad56e7aa5c86e5317d8b1d
---
modules/audio_output/audiotrack.c | 28 ++++++++++++++++++++++++----
1 file changed, 24 insertions(+), 4 deletions(-)
diff --git a/modules/audio_output/audiotrack.c b/modules/audio_output/audiotrack.c
index 86b28a691b..7f0b47ddfd 100644
--- a/modules/audio_output/audiotrack.c
+++ b/modules/audio_output/audiotrack.c
@@ -1159,6 +1159,17 @@ Start( audio_output_t *p_aout, audio_sample_format_t *restrict p_fmt )
aout_FormatPrint( p_aout, "VLC is looking for:", &p_sys->fmt );
+ bool low_latency = false;
+ if (p_sys->fmt.channel_type == AUDIO_CHANNEL_TYPE_AMBISONICS)
+ {
+ p_sys->fmt.channel_type = AUDIO_CHANNEL_TYPE_BITMAP;
+
+ /* TODO: detect sink channel layout */
+ p_sys->fmt.i_physical_channels = AOUT_CHANS_STEREO;
+ aout_FormatPrepare(&p_sys->fmt);
+ low_latency = true;
+ }
+
if( AOUT_FMT_LINEAR( &p_sys->fmt ) )
i_ret = StartPCM( env, p_aout, i_max_channels );
else if( b_try_passthrough )
@@ -1217,11 +1228,20 @@ Start( audio_output_t *p_aout, audio_sample_format_t *restrict p_fmt )
}
p_sys->circular.i_read = p_sys->circular.i_write = 0;
- /* 2 seconds of buffering */
- p_sys->circular.i_size = (int)p_sys->fmt.i_rate * AOUT_MAX_PREPARE_TIME
+ p_sys->circular.i_size = (int)p_sys->fmt.i_rate
* p_sys->fmt.i_bytes_per_frame
- / p_sys->fmt.i_frame_length
- / CLOCK_FREQ;
+ / p_sys->fmt.i_frame_length;
+ if (low_latency)
+ {
+ /* 40 ms of buffering */
+ p_sys->circular.i_size = p_sys->circular.i_size / 25;
+ }
+ else
+ {
+ /* 2 seconds of buffering */
+ p_sys->circular.i_size = p_sys->circular.i_size * AOUT_MAX_PREPARE_TIME
+ / CLOCK_FREQ;
+ }
/* Allocate circular buffer */
switch( p_sys->i_write_type )
More information about the vlc-commits
mailing list