[vlc-devel] [PATCH 03/10] converter/tospdif: always parse dts header

Jean-Baptiste Kempf jb at videolan.org
Wed Jan 18 09:41:36 CET 2017


This requires a comment, explaining the reason, IMHO.

On Wed, 18 Jan 2017, at 09:20, Thomas Guillem wrote:
> 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
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


-- 
Jean-Baptiste Kempf -  President
+33 672 704 734


More information about the vlc-devel mailing list