Commit 836a4433 authored by Francois Cartegnie's avatar Francois Cartegnie Committed by Jean-Baptiste Kempf

demux: avi: simplify dpts code

(cherry picked from commit 5e4b6380fc0468acde12957eb7aa4b9784874565)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent fc5cf8a8
......@@ -1005,7 +1005,6 @@ static int Demux_Seekable( demux_t *p_demux )
for( i_track = 0; i_track < p_sys->i_track; i_track++ )
{
avi_track_t *tk = p_sys->track[i_track];
mtime_t i_dpts;
toread[i_track].b_ok = tk->b_activated && !tk->b_eof;
if( tk->i_idxposc < tk->idx.i_size )
......@@ -1021,20 +1020,15 @@ static int Demux_Seekable( demux_t *p_demux )
toread[i_track].i_posf = -1;
}
i_dpts = p_sys->i_time - AVI_GetPTS( tk );
mtime_t i_dpts = p_sys->i_time - AVI_GetPTS( tk );
if( tk->i_samplesize )
{
toread[i_track].i_toread = AVI_PTSToByte( tk, llabs( i_dpts ) );
toread[i_track].i_toread = AVI_PTSToByte( tk, i_dpts );
}
else if ( i_dpts > -2 * CLOCK_FREQ ) /* don't send a too early dts (low fps video) */
{
toread[i_track].i_toread = AVI_PTSToChunk( tk, llabs( i_dpts ) );
}
if( i_dpts < 0 )
{
toread[i_track].i_toread *= -1;
toread[i_track].i_toread = AVI_PTSToChunk( tk, i_dpts );
}
else
toread[i_track].i_toread = -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment