[vlc-devel] [PATCH 03/10] converter/tospdif: always parse dts header
Thomas Guillem
thomas at gllm.fr
Wed Jan 18 09:20:02 CET 2017
In order to send only the core part (from write_buffer_dts()).
---
modules/audio_filter/converter/tospdif.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/modules/audio_filter/converter/tospdif.c b/modules/audio_filter/converter/tospdif.c
index f8a8a25f2b..bcc1f7c4a0 100644
--- a/modules/audio_filter/converter/tospdif.c
+++ b/modules/audio_filter/converter/tospdif.c
@@ -355,17 +355,14 @@ static int write_buffer_truehd( filter_t *p_filter, block_t *p_in_buf )
static int write_buffer_dts( filter_t *p_filter, block_t *p_in_buf )
{
uint16_t i_data_type;
- if( p_in_buf->i_nb_samples == 0 )
- {
- /* Input is not correctly packetizer. Try to parse the buffer in order
- * to get the mandatory informations to play DTS over S/PDIF */
- vlc_dts_header_t header;
- if( vlc_dts_header_Parse( &header, p_in_buf->p_buffer,
- p_in_buf->i_buffer ) != VLC_SUCCESS )
- return SPDIF_ERROR;
- p_in_buf->i_nb_samples = header.i_frame_length;
- p_in_buf->i_buffer = header.i_frame_size;
- }
+
+ vlc_dts_header_t header;
+ if( vlc_dts_header_Parse( &header, p_in_buf->p_buffer,
+ p_in_buf->i_buffer ) != VLC_SUCCESS )
+ return SPDIF_ERROR;
+ p_in_buf->i_nb_samples = header.i_frame_length;
+ p_in_buf->i_buffer = header.i_frame_size;
+
switch( p_in_buf->i_nb_samples )
{
case 512:
--
2.11.0
More information about the vlc-devel
mailing list