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

liyoubdu liyoubdu at qq.com
Wed Jan 18 09:46:40 CET 2017


which bug?

---Original---
From: "Jean-Baptiste Kempf"<jb at videolan.org>
Date: 2017/1/18 16:41:47
To: "vlc-devel"<vlc-devel at videolan.org>;
Subject: Re: [vlc-devel] [PATCH 03/10] converter/tospdif: always parse dtsheader


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
_______________________________________________
vlc-devel mailing list
To unsubscribe or modify your subscription options:
https://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20170118/e80a3a9b/attachment.html>


More information about the vlc-devel mailing list