Browse Source

rename VLC_TS_0 to VLC_TICK_0

pull/73/head
Steve Lhomme 8 years ago
parent
commit
ded62a069f
  1. 2
      include/vlc_config.h
  2. 2
      modules/access/cdda.c
  3. 6
      modules/access/decklink.cpp
  4. 2
      modules/access/dshow/dshow.cpp
  5. 2
      modules/access/jack.c
  6. 8
      modules/access/live555.cpp
  7. 2
      modules/access/qtsound.m
  8. 4
      modules/access/timecode.c
  9. 4
      modules/codec/avcodec/encoder.c
  10. 2
      modules/codec/dmo/dmo.c
  11. 8
      modules/codec/schroedinger.c
  12. 4
      modules/codec/stl.c
  13. 4
      modules/codec/textst.c
  14. 8
      modules/codec/ttml/substtml.c
  15. 2
      modules/codec/webvtt/subsvtt.c
  16. 4
      modules/demux/adaptive/PlaylistManager.cpp
  17. 8
      modules/demux/adaptive/Streams.cpp
  18. 4
      modules/demux/adaptive/playlist/SegmentList.cpp
  19. 2
      modules/demux/adaptive/plumbing/Demuxer.cpp
  20. 4
      modules/demux/aiff.c
  21. 10
      modules/demux/asf/asf.c
  22. 4
      modules/demux/asf/asfpacket.c
  23. 4
      modules/demux/au.c
  24. 6
      modules/demux/avformat/demux.c
  25. 12
      modules/demux/avi/avi.c
  26. 2
      modules/demux/caf.c
  27. 8
      modules/demux/cdg.c
  28. 4
      modules/demux/flac.c
  29. 2
      modules/demux/gme.c
  30. 2
      modules/demux/hls/playlist/Parser.cpp
  31. 12
      modules/demux/image.c
  32. 2
      modules/demux/mjpeg.c
  33. 2
      modules/demux/mkv/demux.hpp
  34. 4
      modules/demux/mkv/matroska_segment.cpp
  35. 4
      modules/demux/mkv/mkv.cpp
  36. 12
      modules/demux/mkv/virtual_segment.cpp
  37. 8
      modules/demux/mod.c
  38. 2
      modules/demux/mp4/heif.c
  39. 26
      modules/demux/mp4/mp4.c
  40. 2
      modules/demux/mpc.c
  41. 8
      modules/demux/mpeg/es.c
  42. 4
      modules/demux/mpeg/h26x.c
  43. 2
      modules/demux/mpeg/mpeg4_iod.c
  44. 2
      modules/demux/mpeg/mpgv.c
  45. 4
      modules/demux/mpeg/ps.c
  46. 4
      modules/demux/mpeg/timestamps.h
  47. 4
      modules/demux/mpeg/ts.c
  48. 2
      modules/demux/mpeg/ts_scte.c
  49. 10
      modules/demux/nsv.c
  50. 10
      modules/demux/nuv.c
  51. 18
      modules/demux/ogg.c
  52. 2
      modules/demux/ogg_granule.c
  53. 4
      modules/demux/oggseek.c
  54. 6
      modules/demux/pva.c
  55. 2
      modules/demux/rawaud.c
  56. 4
      modules/demux/rawdv.c
  57. 2
      modules/demux/rawvid.c
  58. 6
      modules/demux/real.c
  59. 2
      modules/demux/sid.cpp
  60. 10
      modules/demux/smf.c
  61. 6
      modules/demux/stl.c
  62. 12
      modules/demux/subtitle.c
  63. 2
      modules/demux/tta.c
  64. 8
      modules/demux/ttml.c
  65. 8
      modules/demux/ty.c
  66. 10
      modules/demux/vc1.c
  67. 2
      modules/demux/vobsub.c
  68. 4
      modules/demux/voc.c
  69. 2
      modules/demux/wav.c
  70. 12
      modules/demux/webvtt.c
  71. 2
      modules/demux/xa.c
  72. 2
      modules/misc/stats.c
  73. 4
      modules/packetizer/flac.h
  74. 2
      modules/packetizer/mpegvideo.c
  75. 2
      modules/visualization/goom.c

2
include/vlc_config.h

@ -41,7 +41,7 @@
/* All timestamp below or equal to this define are invalid/unset
* XXX the numerical value is 0 because of historical reason and will change.*/
#define VLC_TICK_INVALID INT64_C(0)
#define VLC_TS_0 INT64_C(1)
#define VLC_TICK_0 INT64_C(1)
#define CLOCK_FREQ INT64_C(1000000)

2
modules/access/cdda.c

@ -254,7 +254,7 @@ static int DemuxOpen(vlc_object_t *obj, vcddev_t *dev, unsigned track)
sys->es = es_out_Add(demux->out, &fmt);
date_Init(&sys->pts, 44100, 1);
date_Set(&sys->pts, VLC_TS_0);
date_Set(&sys->pts, VLC_TICK_0);
sys->position = 0;
demux->pf_demux = Demux;

6
modules/access/decklink.cpp

@ -332,7 +332,7 @@ HRESULT DeckLinkCaptureDelegate::VideoInputFrameArrived(IDeckLinkVideoInputFrame
BMDTimeValue stream_time, frame_duration;
videoFrame->GetStreamTime(&stream_time, &frame_duration, CLOCK_FREQ);
video_frame->i_flags = BLOCK_FLAG_TYPE_I | sys->dominance_flags;
video_frame->i_pts = video_frame->i_dts = VLC_TS_0 + stream_time;
video_frame->i_pts = video_frame->i_dts = VLC_TICK_0 + stream_time;
if (sys->video_fmt.i_codec == VLC_CODEC_I422_10L) {
v210_convert((uint16_t*)video_frame->p_buffer, frame_bytes, width, height);
@ -347,7 +347,7 @@ HRESULT DeckLinkCaptureDelegate::VideoInputFrameArrived(IDeckLinkVideoInputFrame
block_t *cc = vanc_to_cc(demux_, dec, width * 2);
if (!cc)
continue;
cc->i_pts = cc->i_dts = VLC_TS_0 + stream_time;
cc->i_pts = cc->i_dts = VLC_TICK_0 + stream_time;
if (!sys->cc_es) {
es_format_t fmt;
@ -399,7 +399,7 @@ HRESULT DeckLinkCaptureDelegate::VideoInputFrameArrived(IDeckLinkVideoInputFrame
BMDTimeValue packet_time;
audioFrame->GetPacketTime(&packet_time, CLOCK_FREQ);
audio_frame->i_pts = audio_frame->i_dts = VLC_TS_0 + packet_time;
audio_frame->i_pts = audio_frame->i_dts = VLC_TICK_0 + packet_time;
vlc_mutex_lock(&sys->pts_lock);
if (audio_frame->i_pts > sys->last_pts)

2
modules/access/dshow/dshow.cpp

@ -1890,7 +1890,7 @@ static int Demux( demux_t *p_demux )
if( i_pts != VLC_TICK_INVALID ) {
i_pts += 5;
i_pts /= 10; /* 100-ns to µs conversion */
i_pts += VLC_TS_0;
i_pts += VLC_TICK_0;
}
#if 0
msg_Dbg( p_demux, "Read() stream: %i, size: %i, PTS: %" PRId64,

2
modules/access/jack.c

@ -290,7 +290,7 @@ static int Open( vlc_object_t *p_this )
p_sys->p_es_audio = es_out_Add( p_demux->out, &fmt );
date_Init( &p_sys->pts, fmt.audio.i_rate, 1 );
date_Set( &p_sys->pts, VLC_TS_0 );
date_Set( &p_sys->pts, VLC_TICK_0 );
return VLC_SUCCESS;
}

8
modules/access/live555.cpp

@ -1454,7 +1454,7 @@ static int Demux( demux_t *p_demux )
tk->i_next_block_flags |= BLOCK_FLAG_DISCONTINUITY;
}
if( p_sys->i_pcr != VLC_TICK_INVALID )
es_out_SetPCR( p_demux->out, VLC_TS_0 +
es_out_SetPCR( p_demux->out, VLC_TICK_0 +
__MAX(0, p_sys->i_pcr - PCR_OFF) );
}
else if( p_sys->i_pcr == VLC_TICK_INVALID ||
@ -1462,7 +1462,7 @@ static int Demux( demux_t *p_demux )
{
p_sys->i_pcr = __MAX(0, i_minpcr - PCR_OFF);
if( p_sys->i_pcr != VLC_TICK_INVALID )
es_out_SetPCR( p_demux->out, VLC_TS_0 + p_sys->i_pcr );
es_out_SetPCR( p_demux->out, VLC_TICK_0 + p_sys->i_pcr );
}
}
@ -2122,7 +2122,7 @@ static void StreamRead( void *p_private, unsigned int i_size,
break;
default:
if( i_pts != tk->i_lastpts )
p_block->i_pts = VLC_TS_0 + i_pts;
p_block->i_pts = VLC_TICK_0 + i_pts;
/*FIXME: for h264 you should check that packetization-mode=1 in sdp-file */
switch( tk->fmt.i_codec )
{
@ -2133,7 +2133,7 @@ static void StreamRead( void *p_private, unsigned int i_size,
p_block->i_dts = VLC_TICK_INVALID;
break;
default:
p_block->i_dts = VLC_TS_0 + i_pts;
p_block->i_dts = VLC_TICK_0 + i_pts;
break;
}

2
modules/access/qtsound.m

@ -97,7 +97,7 @@ vlc_module_end ()
p_qtsound = p_demux;
currentAudioBuffer = nil;
date_Init(&date, 44100, 1);
date_Set(&date, VLC_TS_0);
date_Set(&date, VLC_TICK_0);
currentPts = 0;
previousPts = 0;
}

4
modules/access/timecode.c

@ -65,7 +65,7 @@ static int DemuxOnce (demux_t *demux, bool master)
lldiv_t d;
unsigned h, m, s, f;
d = lldiv (pts - VLC_TS_0, CLOCK_FREQ);
d = lldiv (pts - VLC_TICK_0, CLOCK_FREQ);
f = d.rem * sys->date.i_divider_num / sys->date.i_divider_den / CLOCK_FREQ;
d = lldiv (d.quot, 60);
s = d.rem;
@ -187,7 +187,7 @@ static int Open (vlc_object_t *obj)
}
date_Init (&sys->date, num, den);
date_Set (&sys->date, VLC_TS_0);
date_Set (&sys->date, VLC_TICK_0);
sys->next_time = VLC_TICK_INVALID;
demux->p_sys = sys;

4
modules/codec/avcodec/encoder.c

@ -1268,7 +1268,7 @@ static block_t *handle_delay_buffer( encoder_t *p_enc, encoder_sys_t *p_sys, uns
if( likely( date_Get( &p_sys->buffer_date ) != VLC_TICK_INVALID) )
{
/* Convert to AV timing */
p_sys->frame->pts = date_Get( &p_sys->buffer_date ) - VLC_TS_0;
p_sys->frame->pts = date_Get( &p_sys->buffer_date ) - VLC_TICK_0;
p_sys->frame->pts = p_sys->frame->pts * p_sys->p_context->time_base.den /
CLOCK_FREQ / p_sys->p_context->time_base.num;
date_Increment( &p_sys->buffer_date, p_sys->frame->nb_samples );
@ -1396,7 +1396,7 @@ static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_aout_buf )
if( likely(date_Get( &p_sys->buffer_date ) != VLC_TICK_INVALID) )
{
/* Convert to AV timing */
p_sys->frame->pts = date_Get( &p_sys->buffer_date ) - VLC_TS_0;
p_sys->frame->pts = date_Get( &p_sys->buffer_date ) - VLC_TICK_0;
p_sys->frame->pts = p_sys->frame->pts * p_sys->p_context->time_base.den /
CLOCK_FREQ / p_sys->p_context->time_base.num;
}

2
modules/codec/dmo/dmo.c

@ -597,7 +597,7 @@ static int DecOpen( decoder_t *p_dec )
date_Init( &p_sys->end_date, p_dec->fmt_in.audio.i_rate, 1 );
else
date_Init( &p_sys->end_date, 25 /* FIXME */, 1 );
date_Set( &p_sys->end_date, VLC_TS_0 );
date_Set( &p_sys->end_date, VLC_TICK_0 );
free( p_vih );
free( p_wf );

8
modules/codec/schroedinger.c

@ -1456,16 +1456,16 @@ static block_t *Encode( encoder_t *p_enc, picture_t *p_pic )
}
date_Init( &date, p_enc->fmt_in.video.i_frame_rate * 2, p_enc->fmt_in.video.i_frame_rate_base );
date_Set( &date, VLC_TS_0 );
date_Set( &date, VLC_TICK_0 );
/* FIXME - Unlike dirac-research codec Schro doesn't have a function that returns the delay in pics yet.
* Use a default of 1
*/
date_Increment( &date, 2 /* 2 fields, 1 frame */ );
p_sys->i_pts_offset = date_Get( &date ) - VLC_TS_0;
p_sys->i_pts_offset = date_Get( &date ) - VLC_TICK_0;
if( schro_encoder_setting_get_double( p_sys->p_schro, "interlaced_coding" ) > 0.0 ) {
date_Set( &date, VLC_TS_0 );
date_Set( &date, VLC_TICK_0 );
date_Increment( &date, 1 /* field */ );
p_sys->i_field_duration = date_Get( &date ) - VLC_TS_0;
p_sys->i_field_duration = date_Get( &date ) - VLC_TICK_0;
}
schro_video_format_set_std_signal_range( p_sys->p_format, SCHRO_SIGNAL_RANGE_8BIT_VIDEO );

4
modules/codec/stl.c

@ -415,8 +415,8 @@ static int Decode(decoder_t *p_dec, block_t *p_block)
if(p_group->i_end && p_group->i_start >= p_block->i_dts)
{
p_sub->i_start = VLC_TS_0 + p_group->i_start;
p_sub->i_stop = VLC_TS_0 + p_group->i_end;
p_sub->i_start = VLC_TICK_0 + p_group->i_start;
p_sub->i_stop = VLC_TICK_0 + p_group->i_end;
}
else
{

4
modules/codec/textst.c

@ -237,8 +237,8 @@ static int Decode(decoder_t *p_dec, block_t *p_block)
{
p_sub->i_start = ((int64_t) (p_block->p_buffer[3] & 0x01) << 32) | GetDWBE(&p_block->p_buffer[4]);
p_sub->i_stop = ((int64_t) (p_block->p_buffer[8] & 0x01) << 32) | GetDWBE(&p_block->p_buffer[9]);
p_sub->i_start = VLC_TS_0 + p_sub->i_start * 100 / 9;
p_sub->i_stop = VLC_TS_0 + p_sub->i_stop * 100 / 9;
p_sub->i_start = VLC_TICK_0 + p_sub->i_start * 100 / 9;
p_sub->i_stop = VLC_TICK_0 + p_sub->i_stop * 100 / 9;
if (p_sub->i_start < p_block->i_dts)
{
p_sub->i_stop += p_block->i_dts - p_sub->i_start;

8
modules/codec/ttml/substtml.c

@ -1252,10 +1252,10 @@ static int ParseBlock( decoder_t *p_dec, const block_t *p_block )
for( size_t i=0; i+1 < i_timings_count; i++ )
{
/* We Only support absolute timings (2) */
if( tt_time_Convert( &p_timings_array[i] ) + VLC_TS_0 < p_block->i_dts )
if( tt_time_Convert( &p_timings_array[i] ) + VLC_TICK_0 < p_block->i_dts )
continue;
if( tt_time_Convert( &p_timings_array[i] ) + VLC_TS_0 > p_block->i_dts + p_block->i_length )
if( tt_time_Convert( &p_timings_array[i] ) + VLC_TICK_0 > p_block->i_dts + p_block->i_length )
break;
bool b_bitmap_regions = false;
@ -1276,8 +1276,8 @@ static int ParseBlock( decoder_t *p_dec, const block_t *p_block )
if( p_regions && p_spu )
{
p_spu->i_start = VLC_TS_0 + tt_time_Convert( &p_timings_array[i] );
p_spu->i_stop = VLC_TS_0 + tt_time_Convert( &p_timings_array[i+1] ) - 1;
p_spu->i_start = VLC_TICK_0 + tt_time_Convert( &p_timings_array[i] );
p_spu->i_stop = VLC_TICK_0 + tt_time_Convert( &p_timings_array[i+1] ) - 1;
p_spu->b_ephemer = true;
p_spu->b_absolute = true;

2
modules/codec/webvtt/subsvtt.c

@ -2061,7 +2061,7 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
decoder_sys_t *p_sys = p_dec->p_sys;
vlc_tick_t i_start = p_block->i_pts - VLC_TS_0;
vlc_tick_t i_start = p_block->i_pts - VLC_TICK_0;
vlc_tick_t i_stop = i_start + p_block->i_length;
if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )

4
modules/demux/adaptive/PlaylistManager.cpp

@ -275,7 +275,7 @@ AbstractStream::status PlaylistManager::dequeue(vlc_tick_t i_floor, vlc_tick_t *
i_return = i_ret;
if( i_pcr > i_floor )
*pi_nzbarrier = std::min( *pi_nzbarrier, i_pcr - VLC_TS_0 );
*pi_nzbarrier = std::min( *pi_nzbarrier, i_pcr - VLC_TICK_0 );
}
return i_return;
@ -479,7 +479,7 @@ int PlaylistManager::doDemux(vlc_tick_t increment)
if( demux.i_nzpcr != VLC_TICK_INVALID && i_nzbarrier != demux.i_nzpcr )
{
demux.i_nzpcr = i_nzbarrier;
vlc_tick_t pcr = VLC_TS_0 + std::max(INT64_C(0), demux.i_nzpcr - CLOCK_FREQ / 10);
vlc_tick_t pcr = VLC_TICK_0 + std::max(INT64_C(0), demux.i_nzpcr - CLOCK_FREQ / 10);
es_out_Control(p_demux->out, ES_OUT_SET_GROUP_PCR, 0, pcr);
}
vlc_mutex_unlock(&demux.lock);

8
modules/demux/adaptive/Streams.cpp

@ -419,7 +419,7 @@ AbstractStream::status AbstractStream::dequeue(vlc_tick_t nz_deadline, vlc_tick_
description.c_str(), commandsqueue->getPCR(), commandsqueue->getFirstDTS(),
nz_deadline));
*pi_pcr = commandsqueue->Process(p_realdemux->out, VLC_TS_0 + nz_deadline);
*pi_pcr = commandsqueue->Process(p_realdemux->out, VLC_TICK_0 + nz_deadline);
if(!commandsqueue->isEmpty())
return AbstractStream::status_demuxed;
@ -440,9 +440,9 @@ AbstractStream::status AbstractStream::dequeue(vlc_tick_t nz_deadline, vlc_tick_
description.c_str(), commandsqueue->getPCR(), commandsqueue->getFirstDTS(),
nz_deadline, commandsqueue->getBufferingLevel()));
if(nz_deadline + VLC_TS_0 <= commandsqueue->getBufferingLevel()) /* demuxed */
if(nz_deadline + VLC_TICK_0 <= commandsqueue->getBufferingLevel()) /* demuxed */
{
*pi_pcr = commandsqueue->Process( p_realdemux->out, VLC_TS_0 + nz_deadline );
*pi_pcr = commandsqueue->Process( p_realdemux->out, VLC_TICK_0 + nz_deadline );
return AbstractStream::status_demuxed;
}
@ -533,7 +533,7 @@ bool AbstractStream::setPosition(vlc_tick_t time, bool tryonly)
else commandsqueue->Abort( true );
es_out_Control(p_realdemux->out, ES_OUT_SET_NEXT_DISPLAY_TIME,
VLC_TS_0 + time);
VLC_TICK_0 + time);
}
return ret;
}

4
modules/demux/adaptive/playlist/SegmentList.cpp

@ -178,7 +178,7 @@ bool SegmentList::getPlaybackTimeDurationBySegmentNumber(uint64_t number,
if(!found)
return false;
*time = VLC_TS_0 + timescale.ToTime(seg_start);
*dur = VLC_TS_0 + timescale.ToTime(seg_dura);
*time = VLC_TICK_0 + timescale.ToTime(seg_start);
*dur = VLC_TICK_0 + timescale.ToTime(seg_dura);
return true;
}

2
modules/demux/adaptive/plumbing/Demuxer.cpp

@ -240,7 +240,7 @@ bool SlaveDemuxer::create()
int SlaveDemuxer::demux(vlc_tick_t nz_deadline)
{
/* Always call with increment or buffering will get slow stuck */
vlc_tick_t i_next_demux_time = VLC_TS_0 + nz_deadline + CLOCK_FREQ / 4;
vlc_tick_t i_next_demux_time = VLC_TICK_0 + nz_deadline + CLOCK_FREQ / 4;
if( demux_Control(p_demux, DEMUX_SET_NEXT_DEMUX_TIME, i_next_demux_time ) != VLC_SUCCESS )
{
b_eof = true;

4
modules/demux/aiff.c

@ -235,7 +235,7 @@ static int Demux( demux_t *p_demux )
}
/* Set PCR */
es_out_SetPCR( p_demux->out, VLC_TS_0 + p_sys->i_time);
es_out_SetPCR( p_demux->out, VLC_TICK_0 + p_sys->i_time);
/* we will read 100ms at once */
i_read = p_sys->i_ssnd_fsize * ( p_sys->fmt.audio.i_rate / 10 );
@ -249,7 +249,7 @@ static int Demux( demux_t *p_demux )
}
p_block->i_dts =
p_block->i_pts = VLC_TS_0 + p_sys->i_time;
p_block->i_pts = VLC_TICK_0 + p_sys->i_time;
p_sys->i_time += CLOCK_FREQ *
p_block->i_buffer /

10
modules/demux/asf/asf.c

@ -248,9 +248,9 @@ static int Demux( demux_t *p_demux )
bool b_data = Block_Dequeue( p_demux, p_sys->i_time + CHUNK );
p_sys->i_time += CHUNK;
es_out_SetPCR( p_demux->out, VLC_TS_0 + p_sys->i_time );
es_out_SetPCR( p_demux->out, VLC_TICK_0 + p_sys->i_time );
#ifdef ASF_DEBUG
msg_Dbg( p_demux, "Demux Loop Setting PCR to %"PRId64, VLC_TS_0 + p_sys->i_time );
msg_Dbg( p_demux, "Demux Loop Setting PCR to %"PRId64, VLC_TICK_0 + p_sys->i_time );
#endif
if ( !b_data && p_sys->b_eos )
{
@ -380,7 +380,7 @@ static int SeekIndex( demux_t *p_demux, vlc_tick_t i_date, float f_pos )
if ( vlc_stream_Seek( p_demux->s, i_offset + p_sys->i_data_begin ) == VLC_SUCCESS )
{
es_out_Control( p_demux->out, ES_OUT_SET_NEXT_DISPLAY_TIME, VLC_TS_0 + i_date );
es_out_Control( p_demux->out, ES_OUT_SET_NEXT_DISPLAY_TIME, VLC_TICK_0 + i_date );
return VLC_SUCCESS;
}
else return VLC_EGENERIC;
@ -689,9 +689,9 @@ static bool Block_Dequeue( demux_t *p_demux, vlc_tick_t i_nexttime )
if( p_sys->i_time == VLC_TICK_INVALID )
{
es_out_SetPCR( p_demux->out, VLC_TS_0 + p_sys->i_time );
es_out_SetPCR( p_demux->out, VLC_TICK_0 + p_sys->i_time );
#ifdef ASF_DEBUG
msg_Dbg( p_demux, " dequeue setting PCR to %"PRId64, VLC_TS_0 + p_sys->i_time );
msg_Dbg( p_demux, " dequeue setting PCR to %"PRId64, VLC_TICK_0 + p_sys->i_time );
#endif
}

4
modules/demux/asf/asfpacket.c

@ -93,8 +93,8 @@ static int DemuxSubPayload( asf_packet_sys_t *p_packetsys,
return -1;
}
p_frag->i_pts = (b_ignore_pts) ? VLC_TICK_INVALID : VLC_TS_0 + i_pts;
p_frag->i_dts = VLC_TS_0 + i_dts;
p_frag->i_pts = (b_ignore_pts) ? VLC_TICK_INVALID : VLC_TICK_0 + i_pts;
p_frag->i_dts = VLC_TICK_0 + i_dts;
if ( b_keyframe )
p_frag->i_flags |= BLOCK_FLAG_TYPE_I;

4
modules/demux/au.c

@ -309,7 +309,7 @@ static int Demux( demux_t *p_demux )
block_t *p_block;
/* set PCR */
es_out_SetPCR( p_demux->out, VLC_TS_0 + p_sys->i_time );
es_out_SetPCR( p_demux->out, VLC_TICK_0 + p_sys->i_time );
p_block = vlc_stream_Block( p_demux->s, p_sys->i_frame_size );
if( p_block == NULL )
@ -319,7 +319,7 @@ static int Demux( demux_t *p_demux )
}
p_block->i_dts =
p_block->i_pts = VLC_TS_0 + p_sys->i_time;
p_block->i_pts = VLC_TICK_0 + p_sys->i_time;
es_out_Send( p_demux->out, p_sys->es, p_block );
p_sys->i_time += p_sys->i_frame_length;

6
modules/demux/avformat/demux.c

@ -828,7 +828,7 @@ static int Demux( demux_t *p_demux )
p_frame->i_dts = q.quot * CLOCK_FREQ *
p_stream->time_base.num + q.rem * CLOCK_FREQ *
p_stream->time_base.num /
p_stream->time_base.den - i_start_time + VLC_TS_0;
p_stream->time_base.den - i_start_time + VLC_TICK_0;
}
if( pkt.pts == (int64_t)AV_NOPTS_VALUE )
@ -839,7 +839,7 @@ static int Demux( demux_t *p_demux )
p_frame->i_pts = q.quot * CLOCK_FREQ *
p_stream->time_base.num + q.rem * CLOCK_FREQ *
p_stream->time_base.num /
p_stream->time_base.den - i_start_time + VLC_TS_0;
p_stream->time_base.den - i_start_time + VLC_TICK_0;
}
if( pkt.duration > 0 && p_frame->i_length <= 0 )
p_frame->i_length = pkt.duration * CLOCK_FREQ *
@ -948,7 +948,7 @@ static void ResetTime( demux_t *p_demux, int64_t i_time )
}
if( t == VLC_TICK_INVALID )
t = VLC_TS_0;
t = VLC_TICK_0;
}
p_sys->i_pcr = t;

12
modules/demux/avi/avi.c

@ -1061,7 +1061,7 @@ static int Demux_Seekable( demux_t *p_demux )
}
/* wait for the good time */
es_out_SetPCR( p_demux->out, VLC_TS_0 + p_sys->i_time );
es_out_SetPCR( p_demux->out, VLC_TICK_0 + p_sys->i_time );
p_sys->i_time += p_sys->i_read_increment;
/* init toread */
@ -1274,7 +1274,7 @@ static int Demux_Seekable( demux_t *p_demux )
continue;
}
p_frame->i_pts = VLC_TS_0 + AVI_GetPTS( tk );
p_frame->i_pts = VLC_TICK_0 + AVI_GetPTS( tk );
if( tk->idx.p_entry[tk->i_idxposc].i_flags&AVIIF_KEYFRAME )
{
p_frame->i_flags = BLOCK_FLAG_TYPE_I;
@ -1364,7 +1364,7 @@ static int Demux_UnSeekable( demux_t *p_demux )
unsigned int i_stream;
unsigned int i_packet;
es_out_SetPCR( p_demux->out, VLC_TS_0 + p_sys->i_time );
es_out_SetPCR( p_demux->out, VLC_TICK_0 + p_sys->i_time );
/* *** find master stream for data packet skipping algo *** */
/* *** -> first video, if any, or first audio ES *** */
@ -1464,7 +1464,7 @@ static int Demux_UnSeekable( demux_t *p_demux )
{
return VLC_DEMUXER_EGENERIC;
}
p_frame->i_pts = VLC_TS_0 + AVI_GetPTS( p_stream );
p_frame->i_pts = VLC_TICK_0 + AVI_GetPTS( p_stream );
if( avi_pk.i_cat != VIDEO_ES )
p_frame->i_dts = p_frame->i_pts;
@ -1644,9 +1644,9 @@ static int Seek( demux_t *p_demux, vlc_tick_t i_date, double f_ratio, bool b_acc
}
}
p_sys->i_time = i_start;
es_out_SetPCR( p_demux->out, VLC_TS_0 + p_sys->i_time );
es_out_SetPCR( p_demux->out, VLC_TICK_0 + p_sys->i_time );
if( b_accurate )
es_out_Control( p_demux->out, ES_OUT_SET_NEXT_DISPLAY_TIME, VLC_TS_0 + i_date );
es_out_Control( p_demux->out, ES_OUT_SET_NEXT_DISPLAY_TIME, VLC_TICK_0 + i_date );
msg_Dbg( p_demux, "seek: %"PRId64" seconds", p_sys->i_time /CLOCK_FREQ );
return VLC_SUCCESS;

2
modules/demux/caf.c

@ -335,7 +335,7 @@ static inline vlc_tick_t FrameSpanGetTime( frame_span_t *span, uint32_t i_sample
if( !i_sample_rate )
return VLC_TICK_INVALID;
return ( span->i_samples * CLOCK_FREQ ) / i_sample_rate + VLC_TS_0;
return ( span->i_samples * CLOCK_FREQ ) / i_sample_rate + VLC_TICK_0;
}
/* SetSpanWithSample returns the span from the beginning of the file up to and

8
modules/demux/cdg.c

@ -100,7 +100,7 @@ static int Open( vlc_object_t * p_this )
/* There is CDG_FRAME_RATE frames per second */
date_Init( &p_sys->pts, CDG_FRAME_RATE, 1 );
date_Set( &p_sys->pts, VLC_TS_0 );
date_Set( &p_sys->pts, VLC_TICK_0 );
p_demux->pf_demux = Demux;
p_demux->pf_control = Control;
@ -132,12 +132,12 @@ static int Demux( demux_t *p_demux )
i_date = vlc_stream_Tell( p_demux->s ) / CDG_FRAME_SIZE * i_delta;
if( i_date >= date_Get( &p_sys->pts ) + i_delta )
{
p_block->i_dts = p_block->i_pts = VLC_TS_0 + i_date;
date_Set( &p_sys->pts, VLC_TS_0 + i_date );
p_block->i_dts = p_block->i_pts = VLC_TICK_0 + i_date;
date_Set( &p_sys->pts, VLC_TICK_0 + i_date );
}
else
{
p_block->i_dts = VLC_TS_0 + i_date;
p_block->i_dts = VLC_TICK_0 + i_date;
p_block->i_pts = date_Get( &p_sys->pts );
}

4
modules/demux/flac.c

@ -372,7 +372,7 @@ static int Demux( demux_t *p_demux )
p_sys->p_current_block->i_flags = p_sys->i_next_block_flags;
p_sys->i_next_block_flags = 0;
p_sys->p_current_block->i_pts =
p_sys->p_current_block->i_dts = p_sys->b_start ? VLC_TS_0 : VLC_TICK_INVALID;
p_sys->p_current_block->i_dts = p_sys->b_start ? VLC_TICK_0 : VLC_TICK_INVALID;
}
while( (p_block_out = GetPacketizedBlock( p_sys->p_packetizer,
@ -389,7 +389,7 @@ static int Demux( demux_t *p_demux )
/* set PCR */
if( unlikely(p_sys->i_pts == VLC_TICK_INVALID) )
es_out_SetPCR( p_demux->out, __MAX(p_block_out->i_dts - 1, VLC_TS_0) );
es_out_SetPCR( p_demux->out, __MAX(p_block_out->i_dts - 1, VLC_TICK_0) );
p_sys->i_pts = p_block_out->i_dts;

2
modules/demux/gme.c

@ -130,7 +130,7 @@ static int Open (vlc_object_t *obj)
sys->es = es_out_Add (demux->out, &fmt);
date_Init (&sys->pts, RATE, 1);
date_Set(&sys->pts, VLC_TS_0);
date_Set(&sys->pts, VLC_TICK_0);
/* Titles */
unsigned n = gme_track_count (sys->emu);

2
modules/demux/hls/playlist/Parser.cpp

@ -301,7 +301,7 @@ void M3U8Parser::parseSegments(vlc_object_t *, Representation *rep, const std::l
case SingleValueTag::EXTXPROGRAMDATETIME:
rep->b_consistent = false;
absReferenceTime = VLC_TS_0 +
absReferenceTime = VLC_TICK_0 +
UTCTime(static_cast<const SingleValueTag *>(tag)->getValue().value).mtime();
break;

12
modules/demux/image.c

@ -209,7 +209,7 @@ static int Demux(demux_t *demux)
for (;;) {
const vlc_tick_t pts = sys->pts_offset + date_Get(&sys->pts);
if (sys->duration >= 0 && pts >= VLC_TS_0 + sys->pts_offset + sys->duration)
if (sys->duration >= 0 && pts >= VLC_TICK_0 + sys->pts_offset + sys->duration)
return VLC_DEMUXER_EOF;
if (pts >= deadline)
@ -220,7 +220,7 @@ static int Demux(demux_t *demux)
return VLC_DEMUXER_EGENERIC;
data->i_dts =
data->i_pts = VLC_TS_0 + pts;
data->i_pts = VLC_TICK_0 + pts;
es_out_SetPCR(demux->out, data->i_pts);
if(sys->es)
es_out_Send(demux->out, sys->es, data);
@ -263,13 +263,13 @@ static int Control(demux_t *demux, int query, va_list args)
if (sys->duration < 0 || sys->is_realtime)
return VLC_EGENERIC;
int64_t time = va_arg(args, int64_t);
date_Set(&sys->pts, VLC_CLIP(time - sys->pts_offset, VLC_TS_0, sys->duration));
date_Set(&sys->pts, VLC_CLIP(time - sys->pts_offset, VLC_TICK_0, sys->duration));
return VLC_SUCCESS;
}
case DEMUX_SET_NEXT_DEMUX_TIME: {
vlc_tick_t pts_next = VLC_TS_0 + va_arg(args, vlc_tick_t);
vlc_tick_t pts_next = VLC_TICK_0 + va_arg(args, vlc_tick_t);
if (sys->pts_next == VLC_TICK_INVALID)
sys->pts_offset = pts_next - VLC_TS_0;
sys->pts_offset = pts_next - VLC_TICK_0;
sys->pts_next = pts_next;
return VLC_SUCCESS;
}
@ -736,7 +736,7 @@ static int Open(vlc_object_t *object)
sys->pts_offset = sys->is_realtime ? vlc_tick_now() : 0;
sys->pts_next = VLC_TICK_INVALID;
date_Init(&sys->pts, fmt.video.i_frame_rate, fmt.video.i_frame_rate_base);
date_Set(&sys->pts, VLC_TS_0);
date_Set(&sys->pts, VLC_TICK_0);
es_format_Clean(&fmt);

2
modules/demux/mjpeg.c

@ -306,7 +306,7 @@ static int Open( vlc_object_t * p_this )
p_demux->p_sys = p_sys;
p_sys->p_es = NULL;
p_sys->i_time = VLC_TS_0;
p_sys->i_time = VLC_TICK_0;
p_sys->i_level = 0;
p_sys->psz_separator = NULL;

2
modules/demux/mkv/demux.hpp

@ -335,7 +335,7 @@ public:
,b_fastseekable(false)
,i_pts(VLC_TICK_INVALID)
,i_pcr(VLC_TICK_INVALID)
,i_start_pts(VLC_TS_0)
,i_start_pts(VLC_TICK_0)
,i_mk_chapter_time(0)
,meta(NULL)
,i_current_title(0)

4
modules/demux/mkv/matroska_segment.cpp

@ -875,9 +875,9 @@ bool matroska_segment_c::Seek( demux_t &demuxer, vlc_tick_t i_absolute_mk_date,
// propogate seek information //
sys.i_pcr = VLC_TICK_INVALID;
sys.i_pts = VLC_TS_0 + i_mk_seek_time + i_mk_time_offset;
sys.i_pts = VLC_TICK_0 + i_mk_seek_time + i_mk_time_offset;
if (b_accurate)
sys.i_start_pts = VLC_TS_0 + i_absolute_mk_date;
sys.i_start_pts = VLC_TICK_0 + i_absolute_mk_date;
else
sys.i_start_pts = sys.i_pts;

4
modules/demux/mkv/mkv.cpp

@ -730,7 +730,7 @@ static int Demux( demux_t *p_demux)
{
/* TODO handle successive chapters with the same user_start_time/user_end_time
*/
p_sys->i_pts = p_chap->i_mk_virtual_stop_time + VLC_TS_0;
p_sys->i_pts = p_chap->i_mk_virtual_stop_time + VLC_TICK_0;
p_sys->i_pts++; // trick to avoid staying on segments with no duration and no content
return 1;
@ -805,7 +805,7 @@ static int Demux( demux_t *p_demux)
/* set pts */
{
p_sys->i_pts = p_sys->i_mk_chapter_time + VLC_TS_0;
p_sys->i_pts = p_sys->i_mk_chapter_time + VLC_TICK_0;
if( simpleblock != NULL ) p_sys->i_pts += simpleblock->GlobalTimecode() / INT64_C( 1000 );
else p_sys->i_pts += block->GlobalTimecode() / INT64_C( 1000 );

12
modules/demux/mkv/virtual_segment.cpp

@ -433,16 +433,16 @@ bool virtual_segment_c::UpdateCurrentToChapter( demux_t & demux )
if ( sys.i_pts != VLC_TICK_INVALID )
{
if ( p_current_vchapter != NULL && p_current_vchapter->ContainsTimestamp( sys.i_pts - VLC_TS_0 ))
if ( p_current_vchapter != NULL && p_current_vchapter->ContainsTimestamp( sys.i_pts - VLC_TICK_0 ))
p_cur_vchapter = p_current_vchapter;
else if (p_cur_vedition != NULL)
p_cur_vchapter = p_cur_vedition->getChapterbyTimecode( sys.i_pts - VLC_TS_0 );
p_cur_vchapter = p_cur_vedition->getChapterbyTimecode( sys.i_pts - VLC_TICK_0 );
}
/* we have moved to a new chapter */
if ( p_cur_vchapter != NULL && p_current_vchapter != p_cur_vchapter )
{
msg_Dbg( &demux, "New Chapter %" PRId64 " uid=%" PRIu64, sys.i_pts - VLC_TS_0,
msg_Dbg( &demux, "New Chapter %" PRId64 " uid=%" PRIu64, sys.i_pts - VLC_TICK_0,
p_cur_vchapter->p_chapter ? p_cur_vchapter->p_chapter->i_uid : 0 );
if ( p_cur_vedition->b_ordered )
{
@ -461,8 +461,8 @@ bool virtual_segment_c::UpdateCurrentToChapter( demux_t & demux )
Seek( demux, p_cur_vchapter->i_mk_virtual_start_time, p_cur_vchapter );
return true;
}
sys.i_start_pts = p_cur_vchapter->i_mk_virtual_start_time + VLC_TS_0;
sys.i_mk_chapter_time = p_cur_vchapter->i_mk_virtual_start_time - p_cur_vchapter->segment.i_mk_start_time - ( ( p_cur_vchapter->p_chapter )? p_cur_vchapter->p_chapter->i_start_time : 0 ) /* + VLC_TS_0 */;
sys.i_start_pts = p_cur_vchapter->i_mk_virtual_start_time + VLC_TICK_0;
sys.i_mk_chapter_time = p_cur_vchapter->i_mk_virtual_start_time - p_cur_vchapter->segment.i_mk_start_time - ( ( p_cur_vchapter->p_chapter )? p_cur_vchapter->p_chapter->i_start_time : 0 ) /* + VLC_TICK_0 */;
}
}
@ -524,7 +524,7 @@ bool virtual_segment_c::Seek( demux_t & demuxer, vlc_tick_t i_mk_date,
{
vlc_tick_t i_mk_time_offset = p_vchapter->i_mk_virtual_start_time - ( ( p_vchapter->p_chapter )? p_vchapter->p_chapter->i_start_time : 0 );
if (CurrentEdition()->b_ordered)
p_sys->i_mk_chapter_time = p_vchapter->i_mk_virtual_start_time - p_vchapter->segment.i_mk_start_time - ( ( p_vchapter->p_chapter )? p_vchapter->p_chapter->i_start_time : 0 ) /* + VLC_TS_0 */;
p_sys->i_mk_chapter_time = p_vchapter->i_mk_virtual_start_time - p_vchapter->segment.i_mk_start_time - ( ( p_vchapter->p_chapter )? p_vchapter->p_chapter->i_start_time : 0 ) /* + VLC_TICK_0 */;
if ( p_vchapter->p_chapter && p_vchapter->i_seekpoint_num > 0 )
{
p_sys->i_updates |= INPUT_UPDATE_TITLE | INPUT_UPDATE_SEEKPOINT;

8
modules/demux/mod.c

@ -217,7 +217,7 @@ static int Open( vlc_object_t *p_this )
/* init time */
date_Init( &p_sys->pts, settings.mFrequency, 1 );
date_Set( &p_sys->pts, VLC_TS_0 );
date_Set( &p_sys->pts, VLC_TICK_0 );
p_sys->i_length = ModPlug_GetLength( p_sys->f ) * INT64_C(1000);
msg_Dbg( p_demux, "MOD loaded name=%s length=%"PRId64"ms",
@ -304,7 +304,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
pf = va_arg( args, double* );
if( p_sys->i_length > 0 )
{
double current = date_Get( &p_sys->pts ) - VLC_TS_0;
double current = date_Get( &p_sys->pts ) - VLC_TICK_0;
double length = p_sys->i_length;
*pf = current / length;
return VLC_SUCCESS;
@ -318,7 +318,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
if( i64 >= 0 && i64 <= p_sys->i_length )
{
ModPlug_Seek( p_sys->f, i64 / 1000 );
date_Set( &p_sys->pts, VLC_TS_0 + i64 );
date_Set( &p_sys->pts, VLC_TICK_0 + i64 );
return VLC_SUCCESS;
}
@ -340,7 +340,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
if( i64 >= 0 && i64 <= p_sys->i_length )
{
ModPlug_Seek( p_sys->f, i64 / 1000 );
date_Set( &p_sys->pts, VLC_TS_0 + i64 );
date_Set( &p_sys->pts, VLC_TICK_0 + i64 );
return VLC_SUCCESS;
}

2
modules/demux/mp4/heif.c

@ -414,7 +414,7 @@ static int DemuxHEIF( demux_t *p_demux )
if( p_sys->i_pcr == VLC_TICK_INVALID )
{
p_sys->i_pcr = VLC_TS_0;
p_sys->i_pcr = VLC_TICK_0;
es_out_SetPCR( p_demux->out, p_sys->i_pcr );
}

26
modules/demux/mp4/mp4.c

@ -1307,12 +1307,12 @@ static int DemuxTrack( demux_t *p_demux, mp4_track_t *tk, uint64_t i_readpos,
/* !important! Ensure clock is set before sending data */
if( p_sys->i_pcr == VLC_TICK_INVALID )
{
es_out_SetPCR( p_demux->out, VLC_TS_0 + i_current_nzdts );
p_sys->i_pcr = VLC_TS_0 + i_current_nzdts;
es_out_SetPCR( p_demux->out, VLC_TICK_0 + i_current_nzdts );
p_sys->i_pcr = VLC_TICK_0 + i_current_nzdts;
}
/* dts */
p_block->i_dts = VLC_TS_0 + i_current_nzdts;
p_block->i_dts = VLC_TICK_0 + i_current_nzdts;
/* pts */
if( MP4_TrackGetPTSDelta( p_demux, tk, &i_delta ) )
p_block->i_pts = p_block->i_dts + i_delta;
@ -1457,7 +1457,7 @@ static int DemuxMoov( demux_t *p_demux )
p_sys->i_nztime += DEMUX_INCREMENT;
if( p_sys->i_pcr != VLC_TICK_INVALID )
{
p_sys->i_pcr = VLC_TS_0 + p_sys->i_nztime;
p_sys->i_pcr = VLC_TICK_0 + p_sys->i_nztime;
es_out_SetPCR( p_demux->out, p_sys->i_pcr );
}
@ -1845,7 +1845,7 @@ static int FragSeekToTime( demux_t *p_demux, vlc_tick_t i_nztime, bool b_accurat
MP4ASF_ResetFrames( p_sys );
/* And set next display time in that trun/fragment */
if( b_iframesync && b_accurate )
es_out_Control( p_demux->out, ES_OUT_SET_NEXT_DISPLAY_TIME, VLC_TS_0 + i_nztime );
es_out_Control( p_demux->out, ES_OUT_SET_NEXT_DISPLAY_TIME, VLC_TICK_0 + i_nztime );
return VLC_SUCCESS;
}
@ -4423,17 +4423,17 @@ static int FragDemuxTrack( demux_t *p_demux, mp4_track_t *p_track,
#if 0
msg_Dbg( p_demux, "tk(%i)=%"PRId64" mv=%"PRId64" pos=%"PRIu64, p_track->i_track_ID,
VLC_TS_0 + MP4_rescale( i_dts, p_track->i_timescale, CLOCK_FREQ ),
VLC_TS_0 + MP4_rescale( i_pts, p_track->i_timescale, CLOCK_FREQ ),
VLC_TICK_0 + MP4_rescale( i_dts, p_track->i_timescale, CLOCK_FREQ ),
VLC_TICK_0 + MP4_rescale( i_pts, p_track->i_timescale, CLOCK_FREQ ),
p_track->context.i_trun_sample_pos );
#endif
if ( p_track->p_es )
{
p_block->i_dts = VLC_TS_0 + MP4_rescale( i_dts, p_track->i_timescale, CLOCK_FREQ );
p_block->i_dts = VLC_TICK_0 + MP4_rescale( i_dts, p_track->i_timescale, CLOCK_FREQ );
if( p_track->fmt.i_cat == VIDEO_ES && !( p_trun->i_flags & MP4_TRUN_SAMPLE_TIME_OFFSET ) )
p_block->i_pts = VLC_TICK_INVALID;
else
p_block->i_pts = VLC_TS_0 + MP4_rescale( i_pts, p_track->i_timescale, CLOCK_FREQ );
p_block->i_pts = VLC_TICK_0 + MP4_rescale( i_pts, p_track->i_timescale, CLOCK_FREQ );
p_block->i_length = MP4_rescale( dur, p_track->i_timescale, CLOCK_FREQ );
MP4_Block_Send( p_demux, p_track, p_block );
}
@ -4464,7 +4464,7 @@ static int DemuxMoof( demux_t *p_demux )
/* !important! Ensure clock is set before sending data */
if( p_sys->i_pcr == VLC_TICK_INVALID )
es_out_SetPCR( p_demux->out, VLC_TS_0 + i_nztime );
es_out_SetPCR( p_demux->out, VLC_TICK_0 + i_nztime );
/* demux up to increment amount of data on every track, or just set pcr if empty data */
for( ;; )
@ -4531,7 +4531,7 @@ static int DemuxMoof( demux_t *p_demux )
if( i_status != VLC_DEMUXER_EOS )
{
p_sys->i_nztime += DEMUX_INCREMENT;
p_sys->i_pcr = VLC_TS_0 + p_sys->i_nztime;
p_sys->i_pcr = VLC_TICK_0 + p_sys->i_nztime;
es_out_SetPCR( p_demux->out, p_sys->i_pcr );
}
else
@ -4550,7 +4550,7 @@ static int DemuxMoof( demux_t *p_demux )
if( i_segment_end != INT64_MAX )
{
p_sys->i_nztime = i_segment_end;
p_sys->i_pcr = VLC_TS_0 + p_sys->i_nztime;
p_sys->i_pcr = VLC_TICK_0 + p_sys->i_nztime;
es_out_SetPCR( p_demux->out, p_sys->i_pcr );
}
}
@ -5077,7 +5077,7 @@ end:
i_demux_end = i_track_end;
}
if( i_demux_end != INT64_MIN )
es_out_SetPCR( p_demux->out, VLC_TS_0 + i_demux_end );
es_out_SetPCR( p_demux->out, VLC_TICK_0 + i_demux_end );
}
return i_status;

2
modules/demux/mpc.c

@ -293,7 +293,7 @@ static int Demux( demux_t *p_demux )
/* */
p_data->i_buffer = i_ret * sizeof(MPC_SAMPLE_FORMAT) * p_sys->info.channels;
p_data->i_dts = p_data->i_pts =
VLC_TS_0 + CLOCK_FREQ * p_sys->i_position / p_sys->info.sample_freq;
VLC_TICK_0 + CLOCK_FREQ * p_sys->i_position / p_sys->info.sample_freq;
es_out_SetPCR( p_demux->out, p_data->i_dts );

8
modules/demux/mpeg/es.c

@ -331,13 +331,13 @@ static int Demux( demux_t *p_demux )
{
if( p_block_out->i_pts == VLC_TICK_INVALID &&
p_block_out->i_dts == VLC_TICK_INVALID )
p_block_out->i_dts = VLC_TS_0 + p_sys->i_pts + CLOCK_FREQ / p_sys->f_fps;
p_block_out->i_dts = VLC_TICK_0 + p_sys->i_pts + CLOCK_FREQ / p_sys->f_fps;
if( p_block_out->i_dts != VLC_TICK_INVALID )
p_sys->i_pts = p_block_out->i_dts - VLC_TS_0;
p_sys->i_pts = p_block_out->i_dts - VLC_TICK_0;
}
else
{
p_sys->i_pts = p_block_out->i_pts - VLC_TS_0;
p_sys->i_pts = p_block_out->i_pts - VLC_TICK_0;
}
if( p_block_out->i_pts != VLC_TICK_INVALID )
@ -505,7 +505,7 @@ static bool Parse( demux_t *p_demux, block_t **pp_output )
swab( p_block_in->p_buffer, p_block_in->p_buffer, p_block_in->i_buffer );
}
p_block_in->i_pts = p_block_in->i_dts = p_sys->b_start || p_sys->b_initial_sync_failed ? VLC_TS_0 : VLC_TICK_INVALID;
p_block_in->i_pts = p_block_in->i_dts = p_sys->b_start || p_sys->b_initial_sync_failed ? VLC_TICK_0 : VLC_TICK_INVALID;
}
p_sys->b_initial_sync_failed = p_sys->b_start; /* Only try to resync once */

4
modules/demux/mpeg/h26x.c

@ -350,7 +350,7 @@ static int GenericOpen( demux_t *p_demux, const char *psz_module,
}
else
date_Init( &p_sys->dts, 25000, 1000 );
date_Set( &p_sys->dts, VLC_TS_0 );
date_Set( &p_sys->dts, VLC_TICK_0 );
/* Load the mpegvideo packetizer */
es_format_Init( &fmt, VIDEO_ES, i_codec );
@ -470,7 +470,7 @@ static int Demux( demux_t *p_demux)
p_sys->frame_rate_den = 1000;
}
date_Init( &p_sys->dts, 2 * p_sys->frame_rate_num, p_sys->frame_rate_den );
date_Set( &p_sys->dts, VLC_TS_0 );
date_Set( &p_sys->dts, VLC_TICK_0 );
msg_Dbg( p_demux, "using %.2f fps", (double) p_sys->frame_rate_num / p_sys->frame_rate_den );
}

2
modules/demux/mpeg/mpeg4_iod.c

@ -602,7 +602,7 @@ sl_header_data DecodeSLHeader( unsigned i_data, const uint8_t *p_data,
i_read |= bs_read( &s, i_bits );
}
if( sl->i_timestamp_resolution )
*(timestamps[i].p_t) = VLC_TS_0 + CLOCK_FREQ * i_read / sl->i_timestamp_resolution;
*(timestamps[i].p_t) = VLC_TICK_0 + CLOCK_FREQ * i_read / sl->i_timestamp_resolution;
}
bs_read( &s, sl->i_AU_length );

2
modules/demux/mpeg/mpgv.c

@ -158,7 +158,7 @@ static int Demux( demux_t *p_demux )
if( p_block_in )
{
p_block_in->i_pts =
p_block_in->i_dts = ( p_sys->b_start ) ? VLC_TS_0 : VLC_TICK_INVALID;
p_block_in->i_dts = ( p_sys->b_start ) ? VLC_TICK_0 : VLC_TICK_INVALID;
}
while( (p_block_out = p_sys->p_packetizer->pf_packetize( p_sys->p_packetizer,

4
modules/demux/mpeg/ps.c

@ -589,7 +589,7 @@ static int Demux( demux_t *p_demux )
p_sys->i_first_scr = -1;
}
else
es_out_SetPCR( p_demux->out, VLC_TS_0 + p_sys->i_pack_scr );
es_out_SetPCR( p_demux->out, VLC_TICK_0 + p_sys->i_pack_scr );
}
if( tk->b_configured && tk->es &&
@ -630,7 +630,7 @@ static int Demux( demux_t *p_demux )
{
/* Teletext may have missing PTS (ETSI EN 300 472 Annexe A)
* In this case use the last SCR + 40ms */
p_pkt->i_pts = VLC_TS_0 + p_sys->i_scr + 40000;
p_pkt->i_pts = VLC_TICK_0 + p_sys->i_scr + 40000;
}
if( (int64_t)p_pkt->i_pts > p_sys->i_current_pts )

4
modules/demux/mpeg/timestamps.h

@ -22,8 +22,8 @@
#define FROM_SCALE_NZ(x) ((x) * 100 / 9)
#define TO_SCALE_NZ(x) ((x) * 9 / 100)
#define FROM_SCALE(x) (VLC_TS_0 + FROM_SCALE_NZ(x))
#define TO_SCALE(x) TO_SCALE_NZ((x) - VLC_TS_0)
#define FROM_SCALE(x) (VLC_TICK_0 + FROM_SCALE_NZ(x))
#define TO_SCALE(x) TO_SCALE_NZ((x) - VLC_TICK_0)
typedef int64_t stime_t;

4
modules/demux/mpeg/ts.c

@ -1005,7 +1005,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
{
ReadyQueuesPostSeek( p_demux );
es_out_Control( p_demux->out, ES_OUT_SET_NEXT_DISPLAY_TIME,
FROM_SCALE(p_pmt->pcr.i_first) + i64 - VLC_TS_0 );
FROM_SCALE(p_pmt->pcr.i_first) + i64 - VLC_TICK_0 );
return VLC_SUCCESS;
}
break;
@ -1978,7 +1978,7 @@ static int SeekToTime( demux_t *p_demux, const ts_pmt_t *p_pmt, stime_t i_scaled
stime_t i_diff = i_scaledtime - TimeStampWrapAround( p_pmt->pcr.i_first, i_pcr );
if ( i_diff < 0 )
i_tail_pos = (i_splitpos >= p_sys->i_packet_size) ? i_splitpos - p_sys->i_packet_size : 0;
else if( i_diff < TO_SCALE(VLC_TS_0 + CLOCK_FREQ / 2) ) // 500ms
else if( i_diff < TO_SCALE(VLC_TICK_0 + CLOCK_FREQ / 2) ) // 500ms
b_found = true;
else
i_head_pos = i_pos;

2
modules/demux/mpeg/ts_scte.c

@ -111,7 +111,7 @@ void SCTE27_Section_Callback( demux_t *p_demux,
}
p_content->i_dts = p_content->i_pts = VLC_TS_0 + i_date * 100 / 9;
p_content->i_dts = p_content->i_pts = VLC_TICK_0 + i_date * 100 / 9;
//PCRFixHandle( p_demux, p_pmt, p_content );
if( p_pes->p_es->id )

10
modules/demux/nsv.c

@ -207,7 +207,7 @@ static int Demux( demux_t *p_demux )
}
/* Set PCR */
es_out_SetPCR( p_demux->out, VLC_TS_0 + p_sys->i_pcr );
es_out_SetPCR( p_demux->out, VLC_TICK_0 + p_sys->i_pcr );
/* Read video */
i_size = ( header[0] >> 4 ) | ( header[1] << 4 ) | ( header[2] << 12 );
@ -257,8 +257,8 @@ static int Demux( demux_t *p_demux )
}
/* Skip the first part (it is the language name) */
p_frame->i_pts = VLC_TS_0 + p_sys->i_pcr;
p_frame->i_dts = VLC_TS_0 + p_sys->i_pcr + 4 * CLOCK_FREQ;
p_frame->i_pts = VLC_TICK_0 + p_sys->i_pcr;
p_frame->i_dts = VLC_TICK_0 + p_sys->i_pcr + 4 * CLOCK_FREQ;
if( p_sys->p_sub )
es_out_Send( p_demux->out, p_sys->p_sub, p_frame );
@ -281,7 +281,7 @@ static int Demux( demux_t *p_demux )
/* msg_Dbg( p_demux, "frame video size=%d", i_size ); */
if( i_size > 0 && ( p_frame = vlc_stream_Block( p_demux->s, i_size ) ) )
{
p_frame->i_dts = VLC_TS_0 + p_sys->i_pcr;
p_frame->i_dts = VLC_TICK_0 + p_sys->i_pcr;
if( p_sys->p_video )
es_out_Send( p_demux->out, p_sys->p_video, p_frame );
@ -318,7 +318,7 @@ static int Demux( demux_t *p_demux )
if( ( p_frame = vlc_stream_Block( p_demux->s, i_size ) ) )
{
p_frame->i_dts =
p_frame->i_pts = VLC_TS_0 + p_sys->i_pcr;
p_frame->i_pts = VLC_TICK_0 + p_sys->i_pcr;
if( p_sys->p_audio )
es_out_Send( p_demux->out, p_sys->p_audio, p_frame );

10
modules/demux/nuv.c

@ -388,20 +388,20 @@ static int Demux( demux_t *p_demux )
if( ( p_data = vlc_stream_Block( p_demux->s, fh.i_length ) ) == NULL )
return VLC_DEMUXER_EOF;
p_data->i_dts = VLC_TS_0 + (int64_t)fh.i_timecode * 1000;
p_data->i_dts = VLC_TICK_0 + (int64_t)fh.i_timecode * 1000;
p_data->i_pts = (fh.i_type == 'V') ? VLC_TICK_INVALID : p_data->i_dts;
/* only add keyframes to index */
if( !fh.i_keyframe && !p_sys->b_index )
demux_IndexAppend( &p_sys->idx,
p_data->i_dts - VLC_TS_0,
p_data->i_dts - VLC_TICK_0,
vlc_stream_Tell(p_demux->s) - NUV_FH_SIZE );
/* */
if( p_sys->i_pcr < 0 || p_sys->i_pcr < p_data->i_dts - VLC_TS_0 )
if( p_sys->i_pcr < 0 || p_sys->i_pcr < p_data->i_dts - VLC_TICK_0 )
{
p_sys->i_pcr = p_data->i_dts - VLC_TS_0;
es_out_SetPCR( p_demux->out, VLC_TS_0 + p_sys->i_pcr );
p_sys->i_pcr = p_data->i_dts - VLC_TICK_0;
es_out_SetPCR( p_demux->out, VLC_TICK_0 + p_sys->i_pcr );
}
if( fh.i_type == 'A' && p_sys->p_es_audio )

18
modules/demux/ogg.c

@ -410,7 +410,7 @@ static int Demux( demux_t * p_demux )
if( i_lastdts != VLC_TICK_INVALID )
{
p_sys->i_nzpcr_offset = i_lastdts - VLC_TS_0;
p_sys->i_nzpcr_offset = i_lastdts - VLC_TICK_0;
if( likely( !p_sys->b_slave ) )
es_out_SetPCR( p_demux->out, i_lastdts );
}
@ -502,7 +502,7 @@ static int Demux( demux_t * p_demux )
msg_Err( p_demux, "Broken Ogg stream (serialno) mismatch" );
Ogg_ResetStream( p_stream );
if( p_stream->i_pcr != VLC_TICK_INVALID )
p_sys->i_nzpcr_offset = p_stream->i_pcr - VLC_TS_0;
p_sys->i_nzpcr_offset = p_stream->i_pcr - VLC_TICK_0;
ogg_stream_reset_serialno( &p_stream->os, ogg_page_serialno( &p_sys->current_page ) );
}
@ -714,12 +714,12 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
return VLC_EGENERIC;
}
vlc_stream_Control( p_demux->s, STREAM_CAN_FASTSEEK, &b );
if ( Oggseek_BlindSeektoAbsoluteTime( p_demux, p_stream, VLC_TS_0 + i64, b ) )
if ( Oggseek_BlindSeektoAbsoluteTime( p_demux, p_stream, VLC_TICK_0 + i64, b ) )
{
Ogg_PreparePostSeek( p_sys );
if( acc )
es_out_Control( p_demux->out, ES_OUT_SET_NEXT_DISPLAY_TIME,
VLC_TS_0 + i64 );
VLC_TICK_0 + i64 );
return VLC_SUCCESS;
}
else
@ -788,11 +788,11 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
assert( p_sys->i_length > 0 );
i64 = CLOCK_FREQ * p_sys->i_length * f;
Ogg_PreparePostSeek( p_sys );
if ( Oggseek_SeektoAbsolutetime( p_demux, p_stream, VLC_TS_0 + i64 ) >= 0 )
if ( Oggseek_SeektoAbsolutetime( p_demux, p_stream, VLC_TICK_0 + i64 ) >= 0 )
{
if( acc )
es_out_Control( p_demux->out, ES_OUT_SET_NEXT_DISPLAY_TIME,
VLC_TS_0 + i64 );
VLC_TICK_0 + i64 );
return VLC_SUCCESS;
}
@ -859,11 +859,11 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
}
vlc_stream_Control( p_demux->s, STREAM_CAN_FASTSEEK, &b );
if ( Oggseek_BlindSeektoAbsoluteTime( p_demux, p_stream, VLC_TS_0 + i64, b ) )
if ( Oggseek_BlindSeektoAbsoluteTime( p_demux, p_stream, VLC_TICK_0 + i64, b ) )
{
Ogg_PreparePostSeek( p_sys );
es_out_Control( p_demux->out, ES_OUT_SET_NEXT_DISPLAY_TIME,
VLC_TS_0 + i64 );
VLC_TICK_0 + i64 );
p_sys->updates |= INPUT_UPDATE_SEEKPOINT;
p_sys->cur_seekpoint = i_seekpoint;
return VLC_SUCCESS;
@ -3252,7 +3252,7 @@ bool Ogg_GetBoundsUsingSkeletonIndex( logical_stream_t *p_stream, vlc_tick_t i_t
i_time == VLC_TICK_INVALID )
return false;
i_time -= VLC_TS_0;
i_time -= VLC_TICK_0;
/* Validate range */
if ( i_time < p_stream->p_skel->i_indexfirstnum

2
modules/demux/ogg_granule.c

@ -169,7 +169,7 @@ vlc_tick_t Ogg_SampleToTime( const logical_stream_t *p_stream, int64_t i_sample,
return VLC_TICK_INVALID;
date_t d = p_stream->dts;
date_Set(&d, VLC_TS_0);
date_Set(&d, VLC_TICK_0);
return date_Increment( &d, i_sample );
}

4
modules/demux/oggseek.c

@ -285,7 +285,7 @@ void Oggseek_ProbeEnd( demux_t *p_demux )
i_length = Ogg_GranuleToTime( p_sys->pp_stream[i], i_granule,
!p_sys->pp_stream[i]->b_contiguous, false );
if( i_length > VLC_TICK_INVALID )
p_sys->i_length = __MAX( p_sys->i_length, (i_length - VLC_TS_0) / 1000000 );
p_sys->i_length = __MAX( p_sys->i_length, (i_length - VLC_TICK_0) / 1000000 );
break;
}
}
@ -795,7 +795,7 @@ int Oggseek_BlindSeektoAbsoluteTime( demux_t *p_demux, logical_stream_t *p_strea
{
/* But only if there's no keyframe/preload requirements */
/* FIXME: add function to get preload time by codec, ex: opus */
i_lowerpos = VLC_TS_0 + (i_time - VLC_TS_0) * p_sys->i_bitrate / INT64_C(8000000);
i_lowerpos = VLC_TICK_0 + (i_time - VLC_TICK_0) * p_sys->i_bitrate / INT64_C(8000000);
b_found = true;
}

6
modules/demux/pva.c

@ -233,7 +233,7 @@ static int Demux( demux_t *p_demux )
p_frame->p_buffer += i_skip;
p_frame->i_buffer -= i_skip;
if( i_pts >= 0 )
p_frame->i_pts = VLC_TS_0 + i_pts * 100 / 9;
p_frame->i_pts = VLC_TICK_0 + i_pts * 100 / 9;
block_ChainAppend( &p_sys->p_es, p_frame );
}
break;
@ -450,9 +450,9 @@ static void ParsePES( demux_t *p_demux )
p_pes->p_buffer += i_skip;
if( i_dts >= 0 )
p_pes->i_dts = VLC_TS_0 + i_dts * 100 / 9;
p_pes->i_dts = VLC_TICK_0 + i_dts * 100 / 9;
if( i_pts >= 0 )
p_pes->i_pts = VLC_TS_0 + i_pts * 100 / 9;
p_pes->i_pts = VLC_TICK_0 + i_pts * 100 / 9;
/* Set PCR */
if( p_pes->i_pts > 0 )

2
modules/demux/rawaud.c

@ -208,7 +208,7 @@ static int Open( vlc_object_t * p_this )
/* initialize timing */
date_Init( &p_sys->pts, p_sys->fmt.audio.i_rate, 1 );
date_Set( &p_sys->pts, VLC_TS_0 );
date_Set( &p_sys->pts, VLC_TICK_0 );
/* calculate 50ms frame size/time */
p_sys->i_frame_samples = __MAX( p_sys->fmt.audio.i_rate / 20, 1 );

4
modules/demux/rawdv.c

@ -263,7 +263,7 @@ static int Demux( demux_t *p_demux )
}
/* Call the pace control */
es_out_SetPCR( p_demux->out, VLC_TS_0 + p_sys->i_pcr );
es_out_SetPCR( p_demux->out, VLC_TICK_0 + p_sys->i_pcr );
p_block = vlc_stream_Block( p_demux->s, p_sys->frame_size );
if( p_block == NULL )
return VLC_DEMUXER_EOF;
@ -275,7 +275,7 @@ static int Demux( demux_t *p_demux )
}
p_block->i_dts =
p_block->i_pts = VLC_TS_0 + p_sys->i_pcr;
p_block->i_pts = VLC_TICK_0 + p_sys->i_pcr;
if( b_audio )
{

2
modules/demux/rawvid.c

@ -341,7 +341,7 @@ valid:
u_fps_num, u_fps_den, 0);
date_Init( &p_sys->pcr, p_sys->fmt_video.video.i_frame_rate,
p_sys->fmt_video.video.i_frame_rate_base );
date_Set( &p_sys->pcr, VLC_TS_0 );
date_Set( &p_sys->pcr, VLC_TICK_0 );
if( !p_sys->fmt_video.video.i_bits_per_pixel )
{

6
modules/demux/real.c

@ -305,7 +305,7 @@ static int Demux( demux_t *p_demux )
//const int i_version = GetWBE( &header[0] );
const size_t i_size = GetWBE( &header[2] ) - 12;
const int i_id = GetWBE( &header[4] );
const int64_t i_pts = VLC_TS_0 + 1000 * GetDWBE( &header[6] );
const int64_t i_pts = VLC_TICK_0 + 1000 * GetDWBE( &header[6] );
const int i_flags= header[11]; /* flags 0x02 -> keyframe */
p_sys->i_data_packets++;
@ -442,9 +442,9 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
{
/* it is a rtsp stream , it is specials in access/rtsp/... */
msg_Dbg(p_demux, "Seek in real rtsp stream!");
p_sys->i_pcr = VLC_TS_0 + INT64_C(1000) * ( p_sys->i_our_duration * f );
p_sys->i_pcr = VLC_TICK_0 + INT64_C(1000) * ( p_sys->i_our_duration * f );
p_sys->b_seek = true;
return vlc_stream_Seek( p_demux->s, p_sys->i_pcr - VLC_TS_0 );
return vlc_stream_Seek( p_demux->s, p_sys->i_pcr - VLC_TICK_0 );
}
return ControlSeekByte( p_demux, i64 );

2
modules/demux/sid.cpp

@ -166,7 +166,7 @@ static int Open (vlc_object_t *obj)
sys->es = es_out_Add (demux->out, &fmt);
date_Init (&sys->pts, fmt.audio.i_rate, 1);
date_Set(&sys->pts, VLC_TS_0);
date_Set(&sys->pts, VLC_TICK_0);
sys->tune->selectSong (0);
result = (sys->player->load (sys->tune) >=0 );

10
modules/demux/smf.c

@ -375,9 +375,9 @@ static int SeekSet0 (demux_t *demux)
/* Default SMF tempo is 120BPM, i.e. half a second per quarter note */
date_Init (&sys->pts, sys->ppqn * 2, 1);
date_Set (&sys->pts, VLC_TS_0);
date_Set (&sys->pts, VLC_TICK_0);
sys->pulse = 0;
sys->tick = VLC_TS_0;
sys->tick = VLC_TICK_0;
for (unsigned i = 0; i < sys->trackc; i++)
{
@ -492,7 +492,7 @@ static int Seek (demux_t *demux, vlc_tick_t pts)
}
sys->pulse = pulse;
sys->tick = ((date_Get (&sys->pts) - VLC_TS_0) / TICK) * TICK + VLC_TS_0;
sys->tick = ((date_Get (&sys->pts) - VLC_TICK_0) / TICK) * TICK + VLC_TICK_0;
return VLC_SUCCESS;
}
@ -511,7 +511,7 @@ static int Control (demux_t *demux, int i_query, va_list args)
case DEMUX_GET_POSITION:
if (!sys->duration)
return VLC_EGENERIC;
*va_arg (args, double *) = (sys->tick - (double)VLC_TS_0)
*va_arg (args, double *) = (sys->tick - (double)VLC_TICK_0)
/ sys->duration;
break;
case DEMUX_SET_POSITION:
@ -520,7 +520,7 @@ static int Control (demux_t *demux, int i_query, va_list args)
*va_arg (args, int64_t *) = sys->duration;
break;
case DEMUX_GET_TIME:
*va_arg (args, int64_t *) = sys->tick - VLC_TS_0;
*va_arg (args, int64_t *) = sys->tick - VLC_TICK_0;
break;
case DEMUX_SET_TIME:
return Seek (demux, va_arg (args, int64_t));

6
modules/demux/stl.c

@ -190,7 +190,7 @@ static int Demux(demux_t *demux)
if (!sys->b_slave && sys->b_first_time)
{
es_out_SetPCR(demux->out, VLC_TS_0 + i_barrier);
es_out_SetPCR(demux->out, VLC_TICK_0 + i_barrier);
sys->b_first_time = false;
}
@ -204,7 +204,7 @@ static int Demux(demux_t *demux)
if (b && b->i_buffer == 128)
{
b->i_dts =
b->i_pts = VLC_TS_0 + s->start;
b->i_pts = VLC_TICK_0 + s->start;
if (s->stop > s->start)
b->i_length = s->stop - s->start;
es_out_Send(demux->out, sys->es, b);
@ -220,7 +220,7 @@ static int Demux(demux_t *demux)
if (!sys->b_slave)
{
es_out_SetPCR(demux->out, VLC_TS_0 + i_barrier);
es_out_SetPCR(demux->out, VLC_TICK_0 + i_barrier);
sys->next_date += CLOCK_FREQ / 8;
}

12
modules/demux/subtitle.c

@ -815,14 +815,14 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
f = va_arg( args, double );
if( p_sys->subtitles.i_count && p_sys->i_length )
{
i64 = VLC_TS_0 + f * p_sys->i_length;
i64 = VLC_TICK_0 + f * p_sys->i_length;
return demux_Control( p_demux, DEMUX_SET_TIME, i64 );
}
break;
case DEMUX_SET_NEXT_DEMUX_TIME:
p_sys->b_slave = true;
p_sys->i_next_demux_date = va_arg( args, vlc_tick_t ) - VLC_TS_0;
p_sys->i_next_demux_date = va_arg( args, vlc_tick_t ) - VLC_TICK_0;
return VLC_SUCCESS;
case DEMUX_CAN_PAUSE:
@ -862,7 +862,7 @@ static int Demux( demux_t *p_demux )
if ( !p_sys->b_slave && p_sys->b_first_time )
{
es_out_SetPCR( p_demux->out, VLC_TS_0 + i_barrier );
es_out_SetPCR( p_demux->out, VLC_TICK_0 + i_barrier );
p_sys->b_first_time = false;
}
@ -872,7 +872,7 @@ static int Demux( demux_t *p_demux )
if( p_block )
{
p_block->i_dts =
p_block->i_pts = VLC_TS_0 + p_subtitle->i_start;
p_block->i_pts = VLC_TICK_0 + p_subtitle->i_start;
if( p_subtitle->i_stop >= 0 && p_subtitle->i_stop >= p_subtitle->i_start )
p_block->i_length = p_subtitle->i_stop - p_subtitle->i_start;
@ -885,7 +885,7 @@ static int Demux( demux_t *p_demux )
if ( !p_sys->b_slave )
{
es_out_SetPCR( p_demux->out, VLC_TS_0 + i_barrier );
es_out_SetPCR( p_demux->out, VLC_TICK_0 + i_barrier );
p_sys->i_next_demux_date += CLOCK_FREQ / 8;
}
@ -2439,7 +2439,7 @@ static int ParseSCC( vlc_object_t *p_obj, subs_properties_t *p_props,
/* convert to frame # at 29.97 */
i_frames = i_frames * framerates[3].rate.num / framerates[3].rate.den + f;
}
p_subtitle->i_start = VLC_TS_0 + i_frames * CLOCK_FREQ *
p_subtitle->i_start = VLC_TICK_0 + i_frames * CLOCK_FREQ *
p_rate->rate.den / p_rate->rate.num;
p_subtitle->i_stop = -1;

2
modules/demux/tta.c

@ -208,7 +208,7 @@ static int Demux( demux_t *p_demux )
p_sys->pi_seektable[p_sys->i_currentframe] );
if( p_data == NULL )
return VLC_DEMUXER_EOF;
p_data->i_dts = p_data->i_pts = VLC_TS_0 + CLOCK_FREQ * p_sys->i_currentframe * TTA_FRAMETIME;
p_data->i_dts = p_data->i_pts = VLC_TICK_0 + CLOCK_FREQ * p_sys->i_currentframe * TTA_FRAMETIME;
p_sys->i_currentframe++;

8
modules/demux/ttml.c

@ -224,7 +224,7 @@ static int Control( demux_t* p_demux, int i_query, va_list args )
i64 = va_arg( args, int64_t );
if( p_sys->times.i_count )
{
tt_time_t t = tt_time_Create( i64 - VLC_TS_0 );
tt_time_t t = tt_time_Create( i64 - VLC_TICK_0 );
size_t i_index = tt_timings_FindLowerIndex( p_sys->times.p_array,
p_sys->times.i_count, t, &b );
p_sys->times.i_current = i_index;
@ -355,7 +355,7 @@ static int Demux( demux_t* p_demux )
if ( !p_sys->b_slave && p_sys->b_first_time )
{
es_out_SetPCR( p_demux->out, VLC_TS_0 + i_playbacktime );
es_out_SetPCR( p_demux->out, VLC_TICK_0 + i_playbacktime );
p_sys->b_first_time = false;
}
@ -373,7 +373,7 @@ static int Demux( demux_t* p_demux )
if( p_block )
{
p_block->i_dts =
p_block->i_pts = VLC_TS_0 + i_playbacktime;
p_block->i_pts = VLC_TICK_0 + i_playbacktime;
p_block->i_length = i_playbackendtime - i_playbacktime;
es_out_Send( p_demux->out, p_sys->p_es, p_block );
@ -385,7 +385,7 @@ static int Demux( demux_t* p_demux )
if ( !p_sys->b_slave )
{
es_out_SetPCR( p_demux->out, VLC_TS_0 + p_sys->i_next_demux_time );
es_out_SetPCR( p_demux->out, VLC_TICK_0 + p_sys->i_next_demux_time );
p_sys->i_next_demux_time += CLOCK_FREQ / 8;
}

8
modules/demux/ty.c

@ -633,7 +633,7 @@ static int check_sync_pes( demux_t *p_demux, block_t *p_block,
return -1; /* partial PES, no audio data */
}
/* full PES header present, extract PTS */
p_sys->lastAudioPTS = VLC_TS_0 + get_pts( &p_block->p_buffer[ offset +
p_sys->lastAudioPTS = VLC_TICK_0 + get_pts( &p_block->p_buffer[ offset +
p_sys->i_Pts_Offset ] );
if (p_sys->firstAudioPTS < 0)
p_sys->firstAudioPTS = p_sys->lastAudioPTS;
@ -696,7 +696,7 @@ static int DemuxRecVideo( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
{
//msg_Dbg(p_demux, "Video PES hdr in pkt type 0x%02x at offset %d",
//subrec_type, esOffset1);
p_sys->lastVideoPTS = VLC_TS_0 + get_pts(
p_sys->lastVideoPTS = VLC_TICK_0 + get_pts(
&p_block_in->p_buffer[ esOffset1 + VIDEO_PTS_OFFSET ] );
/*msg_Dbg(p_demux, "Video rec %d PTS %"PRId64, p_sys->i_cur_rec,
p_sys->lastVideoPTS );*/
@ -873,7 +873,7 @@ static int DemuxRecAudio( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
}
else
{
p_sys->lastAudioPTS = VLC_TS_0 + get_pts(
p_sys->lastAudioPTS = VLC_TICK_0 + get_pts(
&p_sys->pes_buffer[ esOffset1 + p_sys->i_Pts_Offset ] );
p_block_in->i_pts = p_sys->lastAudioPTS;
}
@ -912,7 +912,7 @@ static int DemuxRecAudio( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
/* ================================================ */
if ( ( esOffset1 == 0 ) && ( l_rec_size == 16 ) )
{
p_sys->lastAudioPTS = VLC_TS_0 + get_pts( &p_block_in->p_buffer[
p_sys->lastAudioPTS = VLC_TICK_0 + get_pts( &p_block_in->p_buffer[
SA_PTS_OFFSET ] );
if (p_sys->firstAudioPTS < 0)
p_sys->firstAudioPTS = p_sys->lastAudioPTS;

10
modules/demux/vc1.c

@ -151,8 +151,8 @@ static int Demux( demux_t *p_demux)
else
{
/* */
p_block_in->i_dts = VLC_TS_0;
p_block_in->i_pts = VLC_TS_0;
p_block_in->i_dts = VLC_TICK_0;
p_block_in->i_pts = VLC_TICK_0;
}
while( (p_block_out = p_sys->p_packetizer->pf_packetize( p_sys->p_packetizer,
@ -170,9 +170,9 @@ static int Demux( demux_t *p_demux)
p_sys->p_es = es_out_Add( p_demux->out, &p_sys->p_packetizer->fmt_out);
}
es_out_SetPCR( p_demux->out, VLC_TS_0 + p_sys->i_dts );
p_block_out->i_dts = VLC_TS_0 + p_sys->i_dts;
p_block_out->i_pts = VLC_TS_0 + p_sys->i_dts;
es_out_SetPCR( p_demux->out, VLC_TICK_0 + p_sys->i_dts );
p_block_out->i_dts = VLC_TICK_0 + p_sys->i_dts;
p_block_out->i_pts = VLC_TICK_0 + p_sys->i_dts;
es_out_Send( p_demux->out, p_sys->p_es, p_block_out );

2
modules/demux/vobsub.c

@ -413,7 +413,7 @@ static int Demux( demux_t *p_demux )
p_block->i_buffer = i_read;
/* pts */
p_block->i_pts = VLC_TS_0 + tk.p_subtitles[tk.i_current_subtitle].i_start;
p_block->i_pts = VLC_TICK_0 + tk.p_subtitles[tk.i_current_subtitle].i_start;
/* demux this block */
DemuxVobSub( p_demux, p_block );

4
modules/demux/voc.c

@ -117,7 +117,7 @@ static int Open( vlc_object_t * p_this )
p_sys->p_es = NULL;
date_Init( &p_sys->pts, 1, 1 );
date_Set( &p_sys->pts, VLC_TS_0 );
date_Set( &p_sys->pts, VLC_TICK_0 );
es_format_Init( &p_sys->fmt, AUDIO_ES, 0 );
p_demux->pf_demux = Demux;
@ -515,7 +515,7 @@ static int Demux( demux_t *p_demux )
p_sys->i_silence_countdown -= i_read_frames;
}
p_block->i_dts = p_block->i_pts = VLC_TS_0 + date_Get( &p_sys->pts );
p_block->i_dts = p_block->i_pts = VLC_TICK_0 + date_Get( &p_sys->pts );
p_block->i_nb_samples = i_read_frames * p_sys->fmt.audio.i_frame_length;
date_Increment( &p_sys->pts, p_block->i_nb_samples );
es_out_SetPCR( p_demux->out, p_block->i_pts );

2
modules/demux/wav.c

@ -428,7 +428,7 @@ static int Open( vlc_object_t * p_this )
goto error;
date_Init( &p_sys->pts, p_sys->fmt.audio.i_rate, 1 );
date_Set( &p_sys->pts, VLC_TS_0 );
date_Set( &p_sys->pts, VLC_TICK_0 );
return VLC_SUCCESS;

12
modules/demux/webvtt.c

@ -271,16 +271,16 @@ static void StreamParserCueDoneHandler( void *priv, webvtt_cue_t *p_cue )
{
if ( p_sys->b_first_time )
{
es_out_SetPCR( p_demux->out, p_cue->i_start + VLC_TS_0 );
es_out_SetPCR( p_demux->out, p_cue->i_start + VLC_TICK_0 );
p_sys->b_first_time = false;
}
p_sys->i_next_demux_time = p_cue->i_start;
p_block->i_dts =
p_block->i_pts = VLC_TS_0 + p_cue->i_start;
p_block->i_pts = VLC_TICK_0 + p_cue->i_start;
if( p_cue->i_stop >= 0 && p_cue->i_stop >= p_cue->i_start )
p_block->i_length = p_cue->i_stop - p_cue->i_start;
es_out_Send( p_demux->out, p_sys->es, p_block );
es_out_SetPCR( p_demux->out, p_cue->i_start + VLC_TS_0 );
es_out_SetPCR( p_demux->out, p_cue->i_start + VLC_TICK_0 );
}
}
webvtt_cue_Clean( p_cue );
@ -483,7 +483,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
case DEMUX_SET_NEXT_DEMUX_TIME:
p_sys->b_slave = true;
p_sys->i_next_demux_time = va_arg( args, vlc_tick_t ) - VLC_TS_0;
p_sys->i_next_demux_time = va_arg( args, vlc_tick_t ) - VLC_TICK_0;
return VLC_SUCCESS;
case DEMUX_CAN_PAUSE:
@ -555,7 +555,7 @@ static int Demux( demux_t *p_demux )
if( p_block )
{
p_block->i_length = i_end_time - i_start_time;
p_block->i_dts = p_block->i_pts = VLC_TS_0 + i_start_time;
p_block->i_dts = p_block->i_pts = VLC_TICK_0 + i_start_time;
if( p_sys->i_next_block_flags )
{
@ -582,7 +582,7 @@ static int Demux( demux_t *p_demux )
if ( !p_sys->b_slave )
{
es_out_SetPCR( p_demux->out, VLC_TS_0 + i_barrier );
es_out_SetPCR( p_demux->out, VLC_TICK_0 + i_barrier );
p_sys->i_next_demux_time += CLOCK_FREQ;
}

2
modules/demux/xa.c

@ -146,7 +146,7 @@ static int Open( vlc_object_t * p_this )
return VLC_ENOMEM;
date_Init( &p_sys->pts, fmt.audio.i_rate, 1 );
date_Set( &p_sys->pts, VLC_TS_0 );
date_Set( &p_sys->pts, VLC_TICK_0 );
p_demux->pf_demux = Demux;
p_demux->pf_control = Control;

2
modules/misc/stats.c

@ -189,7 +189,7 @@ static int OpenDemux ( vlc_object_t *p_this )
return VLC_ENOMEM;
date_Init( &p_sys->pts, 1, 1 );
date_Set( &p_sys->pts, VLC_TS_0 );
date_Set( &p_sys->pts, VLC_TICK_0 );
es_format_Init( &p_sys->fmt, VIDEO_ES, VLC_FOURCC('s','t','a','t') );
p_sys->fmt.video.i_width = 720;

4
modules/packetizer/flac.h

@ -260,9 +260,9 @@ static inline int FLAC_ParseSyncInfo(const uint8_t *p_buf,
/* Compute from frame absolute time */
if ( (p_buf[1] & 0x01) == 0 ) /* Fixed blocksize stream / Frames */
h->i_pts = VLC_TS_0 + CLOCK_FREQ * blocksize * i_fsnumber / samplerate;
h->i_pts = VLC_TICK_0 + CLOCK_FREQ * blocksize * i_fsnumber / samplerate;
else /* Variable blocksize stream / Samples */
h->i_pts = VLC_TS_0 + CLOCK_FREQ * i_fsnumber / samplerate;
h->i_pts = VLC_TICK_0 + CLOCK_FREQ * i_fsnumber / samplerate;
h->i_bits_per_sample = bits_per_sample;
h->i_rate = samplerate;

2
modules/packetizer/mpegvideo.c

@ -533,7 +533,7 @@ static block_t *ParseMPEGBlock( decoder_t *p_dec, block_t *p_frag )
{
if( date_Get( &p_sys->dts ) == VLC_TICK_INVALID )
{
date_Set( &p_sys->dts, VLC_TS_0 );
date_Set( &p_sys->dts, VLC_TICK_0 );
}
}
}

2
modules/visualization/goom.c

@ -154,7 +154,7 @@ static int Open( vlc_object_t *p_this )
p_thread->i_blocks = 0;
date_Init( &p_thread->date, p_filter->fmt_in.audio.i_rate, 1 );
date_Set( &p_thread->date, VLC_TS_0 );
date_Set( &p_thread->date, VLC_TICK_0 );
p_thread->i_channels = aout_FormatNbChannels( &p_filter->fmt_in.audio );
if( vlc_clone( &p_thread->thread,

Loading…
Cancel
Save