}
assert( p_sys->i_length > 0 );
- i64 = INT64_C(1000000) * p_sys->i_length * f;
+ i64 = CLOCK_FREQ * p_sys->i_length * f;
Ogg_ResetStreamHelper( p_sys );
if ( Oggseek_SeektoAbsolutetime( p_demux, p_stream, i64 ) >= 0 )
{
sample -= p_stream->i_pre_skip;
else
sample = 0;
- p_stream->i_pcr = sample * INT64_C(1000000) / p_stream->f_rate;
+ p_stream->i_pcr = sample * CLOCK_FREQ / p_stream->f_rate;
}
p_stream->i_pcr += VLC_TS_0;
* If we can't then don't touch the old value. */
if( p_stream->fmt.i_cat == VIDEO_ES )
/* 1 frame per packet */
- p_stream->i_interpolated_pcr += (INT64_C(1000000) / p_stream->f_rate);
+ p_stream->i_interpolated_pcr += (CLOCK_FREQ / p_stream->f_rate);
else if( p_stream->fmt.i_codec == VLC_CODEC_OPUS &&
p_stream->i_previous_granulepos >= 0 &&
( duration =
else
sample = 0;
p_stream->i_interpolated_pcr =
- VLC_TS_0 + sample * INT64_C(1000000) / p_stream->f_rate;
+ VLC_TS_0 + sample * CLOCK_FREQ / p_stream->f_rate;
}
else if( p_stream->fmt.i_bitrate )
{
p_stream->i_interpolated_pcr +=
- ( p_oggpacket->bytes * INT64_C(1000000) /
+ ( p_oggpacket->bytes * CLOCK_FREQ /
p_stream->fmt.i_bitrate / 8 );
}
}
{
i_pts = VLC_TS_0 + (p_stream->i_previous_granulepos
- p_block->i_nb_samples - p_stream->i_pre_skip) *
- INT64_C(1000000) / p_stream->f_rate;
+ CLOCK_FREQ / p_stream->f_rate;
}
p_stream->i_skip_frames = 0;
}
/* granulepos for dirac is possibly broken, this value should be ignored */
if( -1 != p_oggpacket->granulepos )
- p_block->i_pts = u_pnum * INT64_C(1000000) / p_stream->f_rate / 2;
+ p_block->i_pts = u_pnum * CLOCK_FREQ / p_stream->f_rate / 2;
}
else
{
if ( p_stream->b_oggds )
{
- i_timestamp = i_granule * INT64_C(1000000) / p_stream->f_rate;
+ i_timestamp = i_granule * CLOCK_FREQ / p_stream->f_rate;
}
else if( p_stream->fmt.i_codec == VLC_CODEC_THEORA ||
p_stream->fmt.i_codec == VLC_CODEC_KATE )
ogg_int64_t pframe = i_granule - ( iframe << p_stream->i_granule_shift );
/* See Theora A.2.3 */
if ( b_presentation ) pframe -= p_stream->i_keyframe_offset;
- i_timestamp = ( iframe + pframe ) * INT64_C(1000000) / p_stream->f_rate;
+ i_timestamp = ( iframe + pframe ) * CLOCK_FREQ / p_stream->f_rate;
}
else if( p_stream->fmt.i_codec == VLC_CODEC_DIRAC )
{
ogg_int64_t i_dts = i_granule >> 31;
/* NB, OggDirac granulepos values are in units of 2*picturerate */
- i_timestamp = (i_dts/2) * INT64_C(1000000) / p_stream->f_rate;
+ i_timestamp = (i_dts/2) * CLOCK_FREQ / p_stream->f_rate;
}
else if( p_stream->fmt.i_codec == VLC_CODEC_OPUS )
{
- i_timestamp = p_stream->i_pre_skip + i_granule * INT64_C(1000000) / 48000;
+ i_timestamp = p_stream->i_pre_skip + i_granule * CLOCK_FREQ / 48000;
}
else if( p_stream->fmt.i_codec == VLC_CODEC_VORBIS )
{
- i_timestamp = i_granule * INT64_C(1000000) / p_stream->f_rate;
+ i_timestamp = i_granule * CLOCK_FREQ / p_stream->f_rate;
}
return i_timestamp;
p_stream->i_pcr = Oggseek_GranuleToAbsTimestamp( p_stream,
ogg_page_granulepos( p_page ), false );
/* Computes the presentation time of the first packet on page */
- p_stream->i_pcr -= INT64_C(1000000) *
+ p_stream->i_pcr -= CLOCK_FREQ *
ogg_page_packets( p_page ) / p_stream->f_rate;
return true;
}