[vlc-devel] [vlc-commits] Revert "demux:avi: use samples_from_vlc_tick for PTS conversion"

Steve Lhomme robux4 at ycbcr.xyz
Mon Jan 7 09:16:46 CET 2019


This does not seem right, depending on the value of CLOCK_FREQ it may 
return 0.

Also you're supposed to ask before reverting someone's code.

More generally since the i_samplesize is fixed, you should use an 
increment vlc_tick_t per i_pts and always multiply the two. When you 
create this increment just make sure it cannot be 0 or just use the 
date_Increment() API.

On 02/01/2019 23:42, Francois Cartegnie wrote:
> vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jan  2 23:41:30 2019 +0100| [022dacb11b1bd7aafb91d6987e726c1a9c77b1ca] | committer: Francois Cartegnie
>
> Revert "demux:avi: use samples_from_vlc_tick for PTS conversion"
>
> breaks compressed audio / adpcm
>
> This reverts commit 6c3bef5f18bf1647c33fd495367a3192e33bb8ca.
>
>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=022dacb11b1bd7aafb91d6987e726c1a9c77b1ca
> ---
>
>   modules/demux/avi/avi.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
> index a634f9955b..dbd569f73b 100644
> --- a/modules/demux/avi/avi.c
> +++ b/modules/demux/avi/avi.c
> @@ -1727,7 +1727,7 @@ static int64_t AVI_PTSToByte( avi_track_t *tk, vlc_tick_t i_pts )
>           return 0;
>   
>       i_pts = AVI_Rescale( i_pts, tk->i_scale, tk->i_rate );
> -    return samples_from_vlc_tick(i_pts, tk->i_samplesize);
> +    return i_pts / CLOCK_FREQ * tk->i_samplesize;
>   }
>   
>   static vlc_tick_t AVI_GetDPTS( avi_track_t *tk, int64_t i_count )
>
> _______________________________________________
> vlc-commits mailing list
> vlc-commits at videolan.org
> https://mailman.videolan.org/listinfo/vlc-commits



More information about the vlc-devel mailing list