[vlc-devel] [vlc-commits] demux: mp4: remove temporary scaling in parse trun
Rémi Denis-Courmont
remi at remlab.net
Fri May 5 19:29:39 CEST 2017
Le keskiviikkona 3. toukokuuta 2017, 12.54.21 EEST Francois Cartegnie a
écrit :
> vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue May 2
> 13:57:23 2017 +0200| [d1edfc3d4dc39e8861c6fc02eaa30d9c809c9b3b] |
> committer: Francois Cartegnie
>
> demux: mp4: remove temporary scaling in parse trun
>
> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d1edfc3d4dc39e8861c
> > 6fc02eaa30d9c809c9b3b
> ---
>
> modules/demux/mp4/mp4.c | 23 +++++++++--------------
> 1 file changed, 9 insertions(+), 14 deletions(-)
>
> diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
> index 4c4322b758..f64042cf57 100644
> --- a/modules/demux/mp4/mp4.c
> +++ b/modules/demux/mp4/mp4.c
> @@ -4201,14 +4199,11 @@ static int LeafParseTRUN( demux_t *p_demux,
> mp4_track_t *p_track, if( p_trun->i_flags & MP4_TRUN_SAMPLE_TIME_OFFSET )
> {
> if ( p_trun->i_version == 1 )
> - i_nzpts += MP4_rescale( (int32_t)
> p_trun->p_samples[i].i_composition_time_offset, -
> p_track->i_timescale, CLOCK_FREQ ); + i_pts +=
> (int32_t) p_trun->p_samples[i].i_composition_time_offset; else if(
> p_trun->p_samples[i].i_composition_time_offset < 0xFF000000 ) -
> i_nzpts += MP4_rescale( p_trun->p_samples[i].i_composition_time_offset,
> - p_track->i_timescale, CLOCK_FREQ
> ); + i_pts +=
> p_trun->p_samples[i].i_composition_time_offset; else /* version 0 with
> negative */
> - i_nzpts += MP4_rescale( (int32_t)
> p_trun->p_samples[i].i_composition_time_offset, -
> p_track->i_timescale, CLOCK_FREQ ); + i_pts +=
> (int32_t) p_trun->p_samples[i].i_composition_time_offset; }
>
> if( p_trun->i_flags & MP4_TRUN_SAMPLE_SIZE )
Conversion from uint32_t to int32_t is a no-op for positive values and
undefined for negative values. So AFAICT, the code is (still) buggy.
--
雷米‧德尼-库尔蒙
https://www.remlab.net/
More information about the vlc-devel
mailing list