[vlc-commits] converter/tospdif: always parse dts header
Thomas Guillem
git at videolan.org
Tue Jan 24 09:37:05 CET 2017
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Jan 13 09:32:53 2017 +0100| [6c7d1afba910b84ec68169836c0e033c4156ae45] | committer: Thomas Guillem
converter/tospdif: always parse dts header
In order to send only the core part (from write_buffer_dts()).
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6c7d1afba910b84ec68169836c0e033c4156ae45
---
modules/audio_filter/converter/tospdif.c | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/modules/audio_filter/converter/tospdif.c b/modules/audio_filter/converter/tospdif.c
index f8a8a25..d200598 100644
--- a/modules/audio_filter/converter/tospdif.c
+++ b/modules/audio_filter/converter/tospdif.c
@@ -355,17 +355,15 @@ 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;
- }
+
+ /* Only send the DTS core part */
+ vlc_dts_header_t core;
+ if( vlc_dts_header_Parse( &core, p_in_buf->p_buffer,
+ p_in_buf->i_buffer ) != VLC_SUCCESS )
+ return SPDIF_ERROR;
+ p_in_buf->i_nb_samples = core.i_frame_length;
+ p_in_buf->i_buffer = core.i_frame_size;
+
switch( p_in_buf->i_nb_samples )
{
case 512:
More information about the vlc-commits
mailing list