mirror of https://code.videolan.org/videolan/vlc
rename VLC_TS_0 to VLC_TICK_0
(cherry picked from commit ded62a069f
) (edited)
edited:
* some of the 3.0 code was different
This commit is contained in:
parent
0b4dff80ac
commit
e264d5b6af
|
@ -156,6 +156,7 @@ typedef int64_t vlc_tick_t;
|
|||
typedef vlc_tick_t mtime_t; /* deprecated, use vlc_tick_t */
|
||||
|
||||
#define VLC_TICK_INVALID VLC_TS_INVALID
|
||||
#define VLC_TICK_0 VLC_TS_0
|
||||
|
||||
/**
|
||||
* The vlc_fourcc_t type.
|
||||
|
|
|
@ -171,11 +171,11 @@ static int Demux(demux_t *demux)
|
|||
sys->position += count;
|
||||
|
||||
block->i_nb_samples = block->i_buffer / 4;
|
||||
block->i_dts = block->i_pts = VLC_TS_0 + date_Get(&sys->pts);
|
||||
block->i_dts = block->i_pts = VLC_TICK_0 + date_Get(&sys->pts);
|
||||
date_Increment(&sys->pts, block->i_nb_samples);
|
||||
|
||||
es_out_Send(demux->out, sys->es, block);
|
||||
es_out_SetPCR(demux->out, VLC_TS_0 + date_Get(&sys->pts));
|
||||
es_out_SetPCR(demux->out, VLC_TICK_0 + date_Get(&sys->pts));
|
||||
return VLC_DEMUXER_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -334,7 +334,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);
|
||||
|
@ -349,7 +349,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;
|
||||
|
@ -401,7 +401,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)
|
||||
|
|
|
@ -1889,7 +1889,7 @@ static int Demux( demux_t *p_demux )
|
|||
if( i_pts > VLC_TICK_INVALID ) {
|
||||
i_pts += (i_pts >= 0) ? +5 : -4;
|
||||
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,
|
||||
|
|
|
@ -643,7 +643,7 @@ static int DemuxBlock( demux_t *p_demux, const uint8_t *p, int len )
|
|||
int i_mux_rate;
|
||||
if( !ps_pkt_parse_pack( p_pkt, &i_scr, &i_mux_rate ) )
|
||||
{
|
||||
es_out_SetPCR( p_demux->out, VLC_TS_0 + i_scr );
|
||||
es_out_SetPCR( p_demux->out, VLC_TICK_0 + i_scr );
|
||||
if( i_mux_rate > 0 ) p_sys->i_mux_rate = i_mux_rate;
|
||||
}
|
||||
block_Release( p_pkt );
|
||||
|
|
|
@ -1481,7 +1481,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 ||
|
||||
|
@ -1489,7 +1489,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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2151,7 +2151,7 @@ static void StreamRead( void *p_private, unsigned int i_size,
|
|||
default:
|
||||
if( i_pts != tk->i_prevpts )
|
||||
{
|
||||
p_block->i_pts = VLC_TS_0 + i_pts;
|
||||
p_block->i_pts = VLC_TICK_0 + i_pts;
|
||||
tk->i_prevpts = i_pts;
|
||||
|
||||
dtsgen_AddNextPTS( &tk->dtsgen, i_pts );
|
||||
|
@ -2168,7 +2168,7 @@ static void StreamRead( void *p_private, unsigned int i_size,
|
|||
break;
|
||||
case VLC_CODEC_VP8:
|
||||
default:
|
||||
p_block->i_dts = VLC_TS_0 + i_pts;
|
||||
p_block->i_dts = VLC_TICK_0 + i_pts;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ static vlc_tick_t dtsgen_GetDTS(struct dtsgen_t *d)
|
|||
else if(d->count == 1)
|
||||
{
|
||||
d->i_startingdts =
|
||||
i_dts = __MAX(d->history[0] - 150000, VLC_TS_0);
|
||||
i_dts = __MAX(d->history[0] - 150000, VLC_TICK_0);
|
||||
d->i_startingdiff = d->history[0] - i_dts;
|
||||
}
|
||||
else if(d->count > 1)
|
||||
|
|
|
@ -169,7 +169,7 @@ rtp_source_create (demux_t *demux, const rtp_session_t *session,
|
|||
source->ssrc = ssrc;
|
||||
source->jitter = 0;
|
||||
source->ref_rtp = 0;
|
||||
/* TODO: use VLC_TS_0, but VLC does not like negative PTS at the moment */
|
||||
/* TODO: use VLC_TICK_0, but VLC does not like negative PTS at the moment */
|
||||
source->ref_ntp = UINT64_C (1) << 62;
|
||||
source->max_seq = source->bad_seq = init_seq;
|
||||
source->last_seq = init_seq - 1;
|
||||
|
|
|
@ -185,7 +185,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;
|
||||
|
|
|
@ -413,8 +413,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
|
||||
{
|
||||
|
|
|
@ -236,8 +236,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;
|
||||
|
|
|
@ -1060,18 +1060,18 @@ 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;
|
||||
|
||||
subpicture_t *p_spu = NULL;
|
||||
ttml_region_t *p_regions = GenerateRegions( p_rootnode, p_timings_array[i] );
|
||||
if( p_regions && ( p_spu = decoder_NewSubpictureText( p_dec ) ) )
|
||||
{
|
||||
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;
|
||||
|
||||
|
|
|
@ -1808,8 +1808,8 @@ static void RenderRegions( decoder_t *p_dec, vlc_tick_t i_nzstart, vlc_tick_t i_
|
|||
|
||||
if( p_spu )
|
||||
{
|
||||
p_spu->i_start = VLC_TS_0 + i_nzstart;
|
||||
p_spu->i_stop = VLC_TS_0 + i_nzstop;
|
||||
p_spu->i_start = VLC_TICK_0 + i_nzstart;
|
||||
p_spu->i_stop = VLC_TICK_0 + i_nzstop;
|
||||
p_spu->b_ephemer = true; /* !important */
|
||||
p_spu->b_absolute = false; /* can't be absolute as snap to lines can overlap ! */
|
||||
|
||||
|
@ -2061,7 +2061,7 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
|
|||
if( p_block == NULL ) /* No Drain */
|
||||
return VLCDEC_SUCCESS;
|
||||
|
||||
vlc_tick_t i_nzstart = p_block->i_pts - VLC_TS_0;
|
||||
vlc_tick_t i_nzstart = p_block->i_pts - VLC_TICK_0;
|
||||
vlc_tick_t i_nzstop = i_nzstart + p_block->i_length;
|
||||
|
||||
if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
|
||||
|
|
|
@ -382,7 +382,7 @@ bool PlaylistManager::setPosition(vlc_tick_t mediatime, double pos, bool accurat
|
|||
ret = false;
|
||||
}
|
||||
|
||||
if(accurate && ret && streampos.times.continuous >= VLC_TS_0)
|
||||
if(accurate && ret && streampos.times.continuous >= VLC_TICK_0)
|
||||
{
|
||||
es_out_Control(p_demux->out, ES_OUT_SET_NEXT_DISPLAY_TIME,
|
||||
streampos.times.continuous);
|
||||
|
@ -542,7 +542,7 @@ int PlaylistManager::doDemux(int64_t increment)
|
|||
if( demux.times.continuous != VLC_TICK_INVALID && barrier.continuous != demux.times.continuous )
|
||||
{
|
||||
demux.times = barrier;
|
||||
vlc_tick_t pcr = VLC_TS_0 + std::max(INT64_C(0), demux.times.continuous - CLOCK_FREQ/10);
|
||||
vlc_tick_t pcr = VLC_TICK_0 + std::max(INT64_C(0), demux.times.continuous - CLOCK_FREQ/10);
|
||||
es_out_Control(p_demux->out, ES_OUT_SET_GROUP_PCR, 0, pcr);
|
||||
}
|
||||
vlc_mutex_unlock(&demux.lock);
|
||||
|
@ -820,10 +820,10 @@ void PlaylistManager::updateControlsPosition()
|
|||
}
|
||||
}
|
||||
|
||||
if(cached.i_time > VLC_TS_0 + cached.playlistStart &&
|
||||
cached.i_time <= VLC_TS_0 + cached.playlistEnd && cached.playlistLength)
|
||||
if(cached.i_time > VLC_TICK_0 + cached.playlistStart &&
|
||||
cached.i_time <= VLC_TICK_0 + cached.playlistEnd && cached.playlistLength)
|
||||
{
|
||||
cached.f_position = ((double)(cached.i_time - VLC_TS_0 - cached.playlistStart)) / cached.playlistLength;
|
||||
cached.f_position = ((double)(cached.i_time - VLC_TICK_0 - cached.playlistStart)) / cached.playlistLength;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -838,7 +838,7 @@ void PlaylistManager::updateControlsPosition()
|
|||
if(cached.playlistLength && currentTimes.segment.media != VLC_TICK_INVALID)
|
||||
{
|
||||
cached.i_time = currentTimes.segment.media;
|
||||
cached.f_position = (double) (cached.i_time - VLC_TS_0 - cached.playlistStart) / cached.playlistLength;
|
||||
cached.f_position = (double) (cached.i_time - VLC_TICK_0 - cached.playlistStart) / cached.playlistLength;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -330,7 +330,7 @@ SegmentTracker::prepareChunk(bool switch_allowed, Position pos) const
|
|||
vlc_tick_t displayTime = datasegment->getDisplayTime();
|
||||
/* timings belong to timeline and are not set on the segment or need profile timescale */
|
||||
if(pos.rep->getPlaybackTimeDurationBySegmentNumber(pos.number, &startTime, &duration))
|
||||
startTime += VLC_TS_0;
|
||||
startTime += VLC_TICK_0;
|
||||
|
||||
return ChunkEntry(segmentChunk, pos, startTime, duration, displayTime);
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ bool AbstractStream::init(const StreamFormat &format_, SegmentTracker *tracker)
|
|||
segmentTracker->registerListener(this);
|
||||
segmentTracker->notifyBufferingState(true);
|
||||
if(mightalwaysstartfromzero)
|
||||
fakeesout->setExpectedTimestamp(VLC_TS_0 + segmentTracker->getPlaybackTime());
|
||||
fakeesout->setExpectedTimestamp(VLC_TICK_0 + segmentTracker->getPlaybackTime());
|
||||
declaredCodecs();
|
||||
return true;
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ bool AbstractStream::resetForNewPosition(vlc_tick_t seekMediaTime)
|
|||
prevEndTimeContext = SegmentTimes();
|
||||
currentChunk = getNextChunk();
|
||||
if(mightalwaysstartfromzero)
|
||||
fakeEsOut()->setExpectedTimestamp(VLC_TS_0 + seekMediaTime);
|
||||
fakeEsOut()->setExpectedTimestamp(VLC_TICK_0 + seekMediaTime);
|
||||
if( !restartDemux() )
|
||||
{
|
||||
msg_Info(p_realdemux, "Restart demux failed");
|
||||
|
@ -708,7 +708,7 @@ bool AbstractStream::setPosition(const StreamPosition &pos, bool tryonly)
|
|||
{
|
||||
// in some cases, media time seek != sent dts
|
||||
// es_out_Control(p_realdemux->out, ES_OUT_SET_NEXT_DISPLAY_TIME,
|
||||
// VLC_TS_0 + time);
|
||||
// VLC_TICK_0 + time);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -193,7 +193,7 @@ bool SlaveDemuxer::create()
|
|||
AbstractDemuxer::Status 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;
|
||||
|
|
|
@ -323,7 +323,7 @@ static int SegmentTracker_check_formats(BaseAdaptationSet *adaptSet,
|
|||
Expect(currentChunk);
|
||||
Expect(events.occured(TrackerEvent::Type::SegmentChange) == true);
|
||||
Expect(events.occured(TrackerEvent::Type::FormatChange) == true);
|
||||
Expect(events.segmentchanged.starttime == timescale.ToTime(START) + VLC_TS_0);
|
||||
Expect(events.segmentchanged.starttime == timescale.ToTime(START) + VLC_TICK_0);
|
||||
Expect(events.segmentchanged.duration == timescale.ToTime(100));
|
||||
Expect(events.segmentchanged.sequence == 456);
|
||||
Expect(events.formatchanged.format == StreamFormat::Type::PackedAAC);
|
||||
|
@ -333,7 +333,7 @@ static int SegmentTracker_check_formats(BaseAdaptationSet *adaptSet,
|
|||
events.reset();
|
||||
currentChunk = tracker->getNextChunk(true);
|
||||
Expect(currentChunk);
|
||||
Expect(events.segmentchanged.starttime == timescale.ToTime(START + 100 * 1) + VLC_TS_0);
|
||||
Expect(events.segmentchanged.starttime == timescale.ToTime(START + 100 * 1) + VLC_TICK_0);
|
||||
Expect(events.segmentchanged.duration == timescale.ToTime(100));
|
||||
Expect(events.occured(TrackerEvent::Type::FormatChange) == false);
|
||||
Expect(events.occured(TrackerEvent::Type::SegmentChange) == true);
|
||||
|
@ -343,7 +343,7 @@ static int SegmentTracker_check_formats(BaseAdaptationSet *adaptSet,
|
|||
events.reset();
|
||||
currentChunk = tracker->getNextChunk(true);
|
||||
Expect(currentChunk);
|
||||
Expect(events.segmentchanged.starttime == timescale.ToTime(START + 100 * 2) + VLC_TS_0);
|
||||
Expect(events.segmentchanged.starttime == timescale.ToTime(START + 100 * 2) + VLC_TICK_0);
|
||||
Expect(events.segmentchanged.duration == timescale.ToTime(100));
|
||||
Expect(events.occured(TrackerEvent::Type::FormatChange) == true);
|
||||
Expect(events.occured(TrackerEvent::Type::SegmentChange) == true);
|
||||
|
@ -403,12 +403,12 @@ static int SegmentTracker_check_seeks(BaseAdaptationSet *adaptSet,
|
|||
rep0->addAttribute(segmentList);
|
||||
|
||||
events.reset();
|
||||
Expect(tracker->setPositionByTime(VLC_TS_0 + timescale.ToTime(START + 250), false, true) == true);
|
||||
Expect(tracker->setPositionByTime(VLC_TICK_0 + timescale.ToTime(START + 250), false, true) == true);
|
||||
Expect(events.occured(TrackerEvent::Type::PositionChange) == false);
|
||||
Expect(tracker->getPlaybackTime() == 0);
|
||||
|
||||
events.reset();
|
||||
Expect(tracker->setPositionByTime(VLC_TS_0 + timescale.ToTime(START + 250), false, false) == true);
|
||||
Expect(tracker->setPositionByTime(VLC_TICK_0 + timescale.ToTime(START + 250), false, false) == true);
|
||||
currentChunk = tracker->getNextChunk(true);
|
||||
Expect(currentChunk);
|
||||
Expect(events.occured(TrackerEvent::Type::PositionChange) == true);
|
||||
|
@ -419,7 +419,7 @@ static int SegmentTracker_check_seeks(BaseAdaptationSet *adaptSet,
|
|||
|
||||
/* past playlist, align to end */
|
||||
events.reset();
|
||||
Expect(tracker->setPositionByTime(VLC_TS_0 + timescale.ToTime(START + 9999), false, false) == true);
|
||||
Expect(tracker->setPositionByTime(VLC_TICK_0 + timescale.ToTime(START + 9999), false, false) == true);
|
||||
currentChunk = tracker->getNextChunk(true);
|
||||
Expect(currentChunk);
|
||||
Expect(events.occured(TrackerEvent::Type::PositionChange) == true);
|
||||
|
@ -427,8 +427,8 @@ static int SegmentTracker_check_seeks(BaseAdaptationSet *adaptSet,
|
|||
currentChunk = nullptr;
|
||||
|
||||
/* out of playlist, we need to fail */
|
||||
Expect(tracker->setPositionByTime(VLC_TS_0 + timescale.ToTime(START / 2), false, true) == false);
|
||||
Expect(tracker->setPositionByTime(VLC_TS_0 + timescale.ToTime(START / 2), false, false) == false);
|
||||
Expect(tracker->setPositionByTime(VLC_TICK_0 + timescale.ToTime(START / 2), false, true) == false);
|
||||
Expect(tracker->setPositionByTime(VLC_TICK_0 + timescale.ToTime(START / 2), false, false) == false);
|
||||
|
||||
/* restart playlist from startpos */
|
||||
events.reset();
|
||||
|
@ -445,7 +445,7 @@ static int SegmentTracker_check_seeks(BaseAdaptationSet *adaptSet,
|
|||
|
||||
/* go to unaligned pos */
|
||||
events.reset();
|
||||
Expect(tracker->setPositionByTime(VLC_TS_0 + timescale.ToTime(START + 250), false, false) == true);
|
||||
Expect(tracker->setPositionByTime(VLC_TICK_0 + timescale.ToTime(START + 250), false, false) == true);
|
||||
currentChunk = tracker->getNextChunk(true);
|
||||
Expect(currentChunk);
|
||||
Expect(events.occured(TrackerEvent::Type::PositionChange) == true);
|
||||
|
@ -562,7 +562,7 @@ static int SegmentTracker_check_switches(BaseAdaptationSet *adaptSet,
|
|||
Expect(events.representationchanged.next == rep1);
|
||||
/* check returned init */
|
||||
Expect(currentChunk->getContentType() == "sample/aacinit");
|
||||
Expect(events.segmentchanged.starttime == timescale.ToTime(START + 100 * 2) + VLC_TS_0);
|
||||
Expect(events.segmentchanged.starttime == timescale.ToTime(START + 100 * 2) + VLC_TICK_0);
|
||||
Expect(events.segmentchanged.duration == timescale.ToTime(100));
|
||||
Expect(events.segmentchanged.sequence == 456);
|
||||
delete currentChunk;
|
||||
|
@ -575,7 +575,7 @@ static int SegmentTracker_check_switches(BaseAdaptationSet *adaptSet,
|
|||
Expect(events.occured(TrackerEvent::Type::RepresentationSwitch) == false);
|
||||
Expect(currentChunk->getContentType() == "sample/aac");
|
||||
/* time should remain the same */
|
||||
Expect(events.segmentchanged.starttime == timescale.ToTime(START + 100 * 2) + VLC_TS_0);
|
||||
Expect(events.segmentchanged.starttime == timescale.ToTime(START + 100 * 2) + VLC_TICK_0);
|
||||
Expect(events.segmentchanged.duration == timescale.ToTime(100));
|
||||
Expect(events.segmentchanged.sequence == 456);
|
||||
delete currentChunk;
|
||||
|
@ -704,7 +704,7 @@ static int SegmentTracker_check_HLSseeks(BaseAdaptationSet *adaptSet,
|
|||
rep1->addAttribute(segmentList);
|
||||
|
||||
/* on rep0 */
|
||||
Expect(tracker->setPositionByTime(VLC_TS_0 + timescale.ToTime(START + 300), false, false) == true);
|
||||
Expect(tracker->setPositionByTime(VLC_TICK_0 + timescale.ToTime(START + 300), false, false) == true);
|
||||
currentChunk = tracker->getNextChunk(true);
|
||||
Expect(currentChunk);
|
||||
Expect(events.occured(TrackerEvent::Type::PositionChange) == true);
|
||||
|
|
|
@ -450,15 +450,15 @@ int M3U8Playlist_test()
|
|||
/* date set and incremented */
|
||||
seg = rep->getMediaSegment(10);
|
||||
Expect(seg);
|
||||
Expect(static_cast<HLSSegment *>(seg)->getDisplayTime() == VLC_TS_0 + vlc_tick_from_sec(10));
|
||||
Expect(static_cast<HLSSegment *>(seg)->getDisplayTime() == VLC_TICK_0 + vlc_tick_from_sec(10));
|
||||
seg = rep->getMediaSegment(11);
|
||||
Expect(seg);
|
||||
Expect(static_cast<HLSSegment *>(seg)->getDisplayTime() == VLC_TS_0 + vlc_tick_from_sec(10 + 8));
|
||||
Expect(static_cast<HLSSegment *>(seg)->getDisplayTime() == VLC_TICK_0 + vlc_tick_from_sec(10 + 8));
|
||||
|
||||
/* date change after discontinuity */
|
||||
seg = rep->getMediaSegment(20);
|
||||
Expect(seg);
|
||||
Expect(static_cast<HLSSegment *>(seg)->getDisplayTime() == VLC_TS_0 + vlc_tick_from_sec(7200));
|
||||
Expect(static_cast<HLSSegment *>(seg)->getDisplayTime() == VLC_TICK_0 + vlc_tick_from_sec(7200));
|
||||
|
||||
vlc_tick_t begin, end, duration;
|
||||
Expect(rep->getMediaPlaybackRange(&begin, &end, &duration));
|
||||
|
|
|
@ -108,7 +108,7 @@ int CommandsQueue_test()
|
|||
Expect(queue.isEOF() == false);
|
||||
Expect(queue.isDraining() == false);
|
||||
Expect(queue.isEmpty() == true);
|
||||
Expect(queue.getDemuxedAmount(DT(VLC_TS_0)).continuous == 0);
|
||||
Expect(queue.getDemuxedAmount(DT(VLC_TICK_0)).continuous == 0);
|
||||
Expect(queue.getBufferingLevel().continuous == VLC_TICK_INVALID);
|
||||
Expect(queue.getFirstTimes().continuous == VLC_TICK_INVALID);
|
||||
Expect(queue.getPCR().continuous == VLC_TICK_INVALID);
|
||||
|
@ -125,7 +125,7 @@ int CommandsQueue_test()
|
|||
Expect(queue.isEOF() == false);
|
||||
Expect(queue.isDraining() == false);
|
||||
Expect(queue.isEmpty() == true);
|
||||
Expect(queue.getDemuxedAmount(DT(VLC_TS_0)).continuous == 0);
|
||||
Expect(queue.getDemuxedAmount(DT(VLC_TICK_0)).continuous == 0);
|
||||
Expect(queue.getBufferingLevel().continuous == VLC_TICK_INVALID);
|
||||
Expect(queue.getPCR().continuous == std::numeric_limits<mtime_t>::max());
|
||||
|
||||
|
@ -137,34 +137,34 @@ int CommandsQueue_test()
|
|||
{
|
||||
block_t *data = block_Alloc(0);
|
||||
Expect(data);
|
||||
data->i_dts = VLC_TS_0 + vlc_tick_from_sec(i);
|
||||
data->i_dts = VLC_TICK_0 + vlc_tick_from_sec(i);
|
||||
cmd = factory.createEsOutSendCommand(id0, SegmentTimes(), data);
|
||||
queue.Schedule(cmd);
|
||||
}
|
||||
Expect(queue.getPCR().continuous == VLC_TICK_INVALID);
|
||||
Expect(queue.getFirstTimes().continuous == VLC_TICK_INVALID);
|
||||
Expect(queue.getDemuxedAmount(DT(VLC_TS_0)).continuous == 0);
|
||||
Expect(queue.getDemuxedAmount(DT(VLC_TICK_0)).continuous == 0);
|
||||
Expect(queue.getBufferingLevel().continuous == VLC_TICK_INVALID);
|
||||
/* commit some */
|
||||
cmd = factory.createEsOutControlPCRCommand(0, SegmentTimes(), VLC_TS_0 + vlc_tick_from_sec(8));
|
||||
cmd = factory.createEsOutControlPCRCommand(0, SegmentTimes(), VLC_TICK_0 + vlc_tick_from_sec(8));
|
||||
queue.Schedule(cmd);
|
||||
Expect(queue.getDemuxedAmount(DT(VLC_TS_0)).continuous == vlc_tick_from_sec(8)); /* PCR committed data up to 8s */
|
||||
Expect(queue.getBufferingLevel().continuous == VLC_TS_0 + vlc_tick_from_sec(8));
|
||||
Expect(queue.getDemuxedAmount(DT(VLC_TS_0 + vlc_tick_from_sec(8))).continuous == 0);
|
||||
Expect(queue.getDemuxedAmount(DT(VLC_TS_0 + vlc_tick_from_sec(7))).continuous == vlc_tick_from_sec(1));
|
||||
Expect(queue.getDemuxedAmount(DT(VLC_TICK_0)).continuous == vlc_tick_from_sec(8)); /* PCR committed data up to 8s */
|
||||
Expect(queue.getBufferingLevel().continuous == VLC_TICK_0 + vlc_tick_from_sec(8));
|
||||
Expect(queue.getDemuxedAmount(DT(VLC_TICK_0 + vlc_tick_from_sec(8))).continuous == 0);
|
||||
Expect(queue.getDemuxedAmount(DT(VLC_TICK_0 + vlc_tick_from_sec(7))).continuous == vlc_tick_from_sec(1));
|
||||
Expect(queue.getPCR().continuous == VLC_TICK_INVALID);
|
||||
/* extend through PCR */
|
||||
cmd = factory.createEsOutControlPCRCommand(0, SegmentTimes(), VLC_TS_0 + vlc_tick_from_sec(10));
|
||||
cmd = factory.createEsOutControlPCRCommand(0, SegmentTimes(), VLC_TICK_0 + vlc_tick_from_sec(10));
|
||||
queue.Schedule(cmd);
|
||||
Expect(queue.getBufferingLevel().continuous == VLC_TS_0 + vlc_tick_from_sec(10));
|
||||
Expect(queue.getDemuxedAmount(DT(VLC_TS_0)).continuous == vlc_tick_from_sec(10));
|
||||
Expect(queue.getBufferingLevel().continuous == VLC_TICK_0 + vlc_tick_from_sec(10));
|
||||
Expect(queue.getDemuxedAmount(DT(VLC_TICK_0)).continuous == vlc_tick_from_sec(10));
|
||||
|
||||
/* dequeue */
|
||||
queue.Process(Times(SegmentTimes(), VLC_TS_0 + vlc_tick_from_sec(3)));
|
||||
Expect(queue.getPCR().continuous == VLC_TS_0 + vlc_tick_from_sec(3));
|
||||
Expect(queue.getFirstTimes().continuous == VLC_TS_0 + vlc_tick_from_sec(3));
|
||||
Expect(queue.getDemuxedAmount(DT(VLC_TS_0 + vlc_tick_from_sec(3))).continuous == vlc_tick_from_sec(7));
|
||||
Expect(queue.getDemuxedAmount(DT(VLC_TS_0 + vlc_tick_from_sec(4))).continuous == vlc_tick_from_sec(6));
|
||||
queue.Process(Times(SegmentTimes(), VLC_TICK_0 + vlc_tick_from_sec(3)));
|
||||
Expect(queue.getPCR().continuous == VLC_TICK_0 + vlc_tick_from_sec(3));
|
||||
Expect(queue.getFirstTimes().continuous == VLC_TICK_0 + vlc_tick_from_sec(3));
|
||||
Expect(queue.getDemuxedAmount(DT(VLC_TICK_0 + vlc_tick_from_sec(3))).continuous == vlc_tick_from_sec(7));
|
||||
Expect(queue.getDemuxedAmount(DT(VLC_TICK_0 + vlc_tick_from_sec(4))).continuous == vlc_tick_from_sec(6));
|
||||
|
||||
/* drop */
|
||||
queue.setDrop(true);
|
||||
|
@ -172,21 +172,21 @@ int CommandsQueue_test()
|
|||
{
|
||||
block_t *data = block_Alloc(0);
|
||||
Expect(data);
|
||||
data->i_dts = VLC_TS_0 + vlc_tick_from_sec(11);
|
||||
data->i_dts = VLC_TICK_0 + vlc_tick_from_sec(11);
|
||||
cmd = factory.createEsOutSendCommand(id0, SegmentTimes(), data);
|
||||
queue.Schedule(cmd);
|
||||
} while(0);
|
||||
cmd = factory.createEsOutControlPCRCommand(0, SegmentTimes(), VLC_TS_0 + vlc_tick_from_sec(11));
|
||||
cmd = factory.createEsOutControlPCRCommand(0, SegmentTimes(), VLC_TICK_0 + vlc_tick_from_sec(11));
|
||||
queue.Schedule(cmd);
|
||||
Expect(queue.getPCR().continuous == VLC_TS_0 + vlc_tick_from_sec(3)); /* should be unchanged */
|
||||
Expect(queue.getDemuxedAmount(DT(VLC_TS_0 + vlc_tick_from_sec(3))).continuous == vlc_tick_from_sec(7));
|
||||
Expect(queue.getPCR().continuous == VLC_TICK_0 + vlc_tick_from_sec(3)); /* should be unchanged */
|
||||
Expect(queue.getDemuxedAmount(DT(VLC_TICK_0 + vlc_tick_from_sec(3))).continuous == vlc_tick_from_sec(7));
|
||||
queue.setDrop(false);
|
||||
|
||||
/* empty */
|
||||
Expect(queue.getPCR().continuous == VLC_TS_0 + vlc_tick_from_sec(3));
|
||||
queue.Process(DT(VLC_TS_0 + vlc_tick_from_sec(13)));
|
||||
Expect(queue.getPCR().continuous == VLC_TICK_0 + vlc_tick_from_sec(3));
|
||||
queue.Process(DT(VLC_TICK_0 + vlc_tick_from_sec(13)));
|
||||
Expect(queue.isEmpty());
|
||||
Expect(queue.getPCR().continuous == VLC_TS_0 + vlc_tick_from_sec(9));
|
||||
Expect(queue.getPCR().continuous == VLC_TICK_0 + vlc_tick_from_sec(9));
|
||||
|
||||
queue.Abort(true);
|
||||
esout.cleanup();
|
||||
|
@ -201,23 +201,23 @@ int CommandsQueue_test()
|
|||
{
|
||||
block_t *data = block_Alloc(0);
|
||||
Expect(data);
|
||||
data->i_dts = VLC_TS_0 + OFFSET + vlc_tick_from_sec(i);
|
||||
data->i_dts = VLC_TICK_0 + OFFSET + vlc_tick_from_sec(i);
|
||||
cmd = factory.createEsOutSendCommand(id, SegmentTimes(), data);
|
||||
queue.Schedule(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
cmd = factory.createEsOutControlPCRCommand(0, SegmentTimes(),
|
||||
VLC_TS_0 + OFFSET + vlc_tick_from_sec(10));
|
||||
VLC_TICK_0 + OFFSET + vlc_tick_from_sec(10));
|
||||
queue.Schedule(cmd);
|
||||
Expect(esout.output.empty());
|
||||
queue.Process(DT(VLC_TS_0 + OFFSET - 1));
|
||||
queue.Process(DT(VLC_TICK_0 + OFFSET - 1));
|
||||
Expect(esout.output.empty());
|
||||
queue.Process(DT(VLC_TS_0 + OFFSET + vlc_tick_from_sec(10)));
|
||||
queue.Process(DT(VLC_TICK_0 + OFFSET + vlc_tick_from_sec(10)));
|
||||
Expect(esout.output.size() == 10);
|
||||
for(size_t i=0; i<5; i++)
|
||||
{
|
||||
const vlc_tick_t now = VLC_TS_0 + OFFSET + vlc_tick_from_sec(i);
|
||||
const vlc_tick_t now = VLC_TICK_0 + OFFSET + vlc_tick_from_sec(i);
|
||||
OutputVal val = esout.output.front();
|
||||
Expect(val.first == id0);
|
||||
Expect(val.second->i_dts == now);
|
||||
|
@ -242,13 +242,13 @@ int CommandsQueue_test()
|
|||
{
|
||||
block_t *data = block_Alloc(0);
|
||||
Expect(data);
|
||||
data->i_dts = VLC_TS_0 + OFFSET + vlc_tick_from_sec(k * 2 + i);
|
||||
data->i_dts = VLC_TICK_0 + OFFSET + vlc_tick_from_sec(k * 2 + i);
|
||||
cmd = factory.createEsOutSendCommand(id, SegmentTimes(), data);
|
||||
queue.Schedule(cmd);
|
||||
}
|
||||
}
|
||||
cmd = factory.createEsOutControlPCRCommand(0, SegmentTimes(),
|
||||
VLC_TS_0 + OFFSET + vlc_tick_from_sec( (k*2)+1 ));
|
||||
VLC_TICK_0 + OFFSET + vlc_tick_from_sec( (k*2)+1 ));
|
||||
queue.Schedule(cmd);
|
||||
}
|
||||
queue.Process(Times(SegmentTimes(), std::numeric_limits<mtime_t>::max()));
|
||||
|
@ -256,7 +256,7 @@ int CommandsQueue_test()
|
|||
for(size_t i=0; i<12; i++)
|
||||
{
|
||||
TestEsOutID *id = (i % 2) ? id1 : id0;
|
||||
const vlc_tick_t now = VLC_TS_0 + OFFSET + vlc_tick_from_sec(i / 2);
|
||||
const vlc_tick_t now = VLC_TICK_0 + OFFSET + vlc_tick_from_sec(i / 2);
|
||||
OutputVal &val = esout.output.front();
|
||||
Expect(val.first == id);
|
||||
Expect(val.second->i_dts == now);
|
||||
|
@ -277,13 +277,13 @@ int CommandsQueue_test()
|
|||
block_t *data = block_Alloc(0);
|
||||
Expect(data);
|
||||
if(i==0)
|
||||
data->i_dts = VLC_TS_0 + OFFSET + vlc_tick_from_sec(k);
|
||||
data->i_dts = VLC_TICK_0 + OFFSET + vlc_tick_from_sec(k);
|
||||
cmd = factory.createEsOutSendCommand(id, SegmentTimes(), data);
|
||||
queue.Schedule(cmd);
|
||||
}
|
||||
}
|
||||
cmd = factory.createEsOutControlPCRCommand(0, SegmentTimes(),
|
||||
VLC_TS_0 + OFFSET + vlc_tick_from_sec(k));
|
||||
VLC_TICK_0 + OFFSET + vlc_tick_from_sec(k));
|
||||
queue.Schedule(cmd);
|
||||
}
|
||||
queue.Process(Times(SegmentTimes(), std::numeric_limits<mtime_t>::max()));
|
||||
|
@ -291,7 +291,7 @@ int CommandsQueue_test()
|
|||
for(size_t i=0; i<6; i++)
|
||||
{
|
||||
TestEsOutID *id = (i % 2) ? id1 : id0;
|
||||
const vlc_tick_t now = VLC_TS_0 + OFFSET + vlc_tick_from_sec(i/2);
|
||||
const vlc_tick_t now = VLC_TICK_0 + OFFSET + vlc_tick_from_sec(i/2);
|
||||
OutputVal val = esout.output.front();
|
||||
Expect(val.first == id);
|
||||
Expect(val.second->i_dts == now);
|
||||
|
@ -309,7 +309,7 @@ int CommandsQueue_test()
|
|||
/* reordering PCR before PTS */
|
||||
for(size_t i=0; i<2; i++)
|
||||
{
|
||||
const vlc_tick_t now = VLC_TS_0 + OFFSET + vlc_tick_from_sec(i);
|
||||
const vlc_tick_t now = VLC_TICK_0 + OFFSET + vlc_tick_from_sec(i);
|
||||
cmd = factory.createEsOutControlPCRCommand(0, SegmentTimes(), now);
|
||||
queue.Schedule(cmd);
|
||||
block_t *data = block_Alloc(0);
|
||||
|
@ -318,7 +318,7 @@ int CommandsQueue_test()
|
|||
cmd = factory.createEsOutSendCommand(id0, SegmentTimes(), data);
|
||||
queue.Schedule(cmd);
|
||||
}
|
||||
queue.Process(DT(VLC_TS_0 + OFFSET + vlc_tick_from_sec(0)));
|
||||
queue.Process(DT(VLC_TICK_0 + OFFSET + vlc_tick_from_sec(0)));
|
||||
Expect(esout.output.size() == 1);
|
||||
|
||||
} catch(...) {
|
||||
|
|
|
@ -110,7 +110,7 @@ static void enqueue(es_out_t *out, es_out_id_t *id, vlc_tick_t dts, vlc_tick_t p
|
|||
}
|
||||
|
||||
#define DMS(t) ((t)*INT64_C(1000))
|
||||
#define TMS(t) (VLC_TS_0 + DMS(t))
|
||||
#define TMS(t) (VLC_TICK_0 + DMS(t))
|
||||
#define SEND(t) enqueue(out, id, t, t)
|
||||
#define PCR(t) es_out_SetPCR(out, t)
|
||||
#define FROM_MPEGTS(x) (INT64_C(x) * 100 / 9)
|
||||
|
@ -241,7 +241,7 @@ static int check1(es_out_t *out, struct context *ctx, FakeESOut *fakees)
|
|||
Expect(ts == reference + DMS(1000));
|
||||
|
||||
/* Reference has local multiple rolled timestamp < multiple rolled ts */
|
||||
reference = VLC_TS_0 + FROM_MPEGTS(0x1FFFFFFFF) * 2;
|
||||
reference = VLC_TICK_0 + FROM_MPEGTS(0x1FFFFFFFF) * 2;
|
||||
fakees->resetTimestamps();
|
||||
fakees->setSegmentStartTimes(segmentTimes);
|
||||
fakees->setSynchronizationReference(SynchronizationReference());
|
||||
|
@ -254,34 +254,34 @@ static int check1(es_out_t *out, struct context *ctx, FakeESOut *fakees)
|
|||
|
||||
|
||||
/* Reference has local timestamp rolled > ts */
|
||||
reference = VLC_TS_0 + FROM_MPEGTS(0x1FFFFFFFF);
|
||||
reference = VLC_TICK_0 + FROM_MPEGTS(0x1FFFFFFFF);
|
||||
fakees->resetTimestamps();
|
||||
fakees->setSegmentStartTimes(segmentTimes);
|
||||
fakees->setSynchronizationReference(SynchronizationReference());
|
||||
SEND(reference);
|
||||
PCR(reference);
|
||||
Expect(fakees->commandsQueue()->getBufferingLevel().continuous == reference);
|
||||
ts = VLC_TS_0 + 1;
|
||||
ts = VLC_TICK_0 + 1;
|
||||
ts = fakees->applyTimestampContinuity(ts);
|
||||
fprintf(stderr, "timestamp %ld\n", ts);
|
||||
Expect(ts == reference + 1);
|
||||
|
||||
/* Reference has local timestamp mutiple rolled > multiple rolled ts */
|
||||
reference = VLC_TS_0 + FROM_MPEGTS(0x1FFFFFFFF) * 5;
|
||||
reference = VLC_TICK_0 + FROM_MPEGTS(0x1FFFFFFFF) * 5;
|
||||
fakees->resetTimestamps();
|
||||
fakees->setSegmentStartTimes(segmentTimes);
|
||||
fakees->setSynchronizationReference(SynchronizationReference());
|
||||
SEND(reference);
|
||||
PCR(reference);
|
||||
Expect(fakees->commandsQueue()->getBufferingLevel().continuous == reference);
|
||||
ts = VLC_TS_0 + 1 + FROM_MPEGTS(0x1FFFFFFFF) * 2;
|
||||
ts = VLC_TICK_0 + 1 + FROM_MPEGTS(0x1FFFFFFFF) * 2;
|
||||
ts = fakees->applyTimestampContinuity(ts);
|
||||
fprintf(stderr, "timestamp %ld\n", ts);
|
||||
Expect(ts == reference + 1);
|
||||
|
||||
/* Do not trigger unwanted roll on long playbacks due to
|
||||
* initial reference value */
|
||||
reference = VLC_TS_0 + FROM_MPEGTS(0x00000FFFF);
|
||||
reference = VLC_TICK_0 + FROM_MPEGTS(0x00000FFFF);
|
||||
fakees->resetTimestamps();
|
||||
fakees->setSegmentStartTimes(segmentTimes);
|
||||
fakees->setSynchronizationReference(SynchronizationReference());
|
||||
|
@ -301,7 +301,7 @@ static int check1(es_out_t *out, struct context *ctx, FakeESOut *fakees)
|
|||
SEND(ts);
|
||||
PCR(ts);
|
||||
fakees->commandsQueue()->Process(drainTimes);
|
||||
ts = VLC_TS_0 + 100; /* next ts has rolled */
|
||||
ts = VLC_TICK_0 + 100; /* next ts has rolled */
|
||||
SEND(ts);
|
||||
PCR(ts);
|
||||
fakees->commandsQueue()->Process(drainTimes);
|
||||
|
|
|
@ -247,7 +247,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 );
|
||||
|
@ -261,7 +261,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 += (int64_t)1000000 *
|
||||
p_block->i_buffer /
|
||||
|
|
|
@ -390,7 +390,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;
|
||||
|
@ -593,7 +593,7 @@ static void Packet_SetAR( asf_packet_sys_t *p_packetsys, uint8_t i_stream_number
|
|||
|
||||
static void Packet_SetSendTime( asf_packet_sys_t *p_packetsys, vlc_tick_t i_time )
|
||||
{
|
||||
p_packetsys->p_demux->p_sys->i_sendtime = VLC_TS_0 + i_time;
|
||||
p_packetsys->p_demux->p_sys->i_sendtime = VLC_TICK_0 + i_time;
|
||||
}
|
||||
|
||||
static void Packet_UpdateTime( asf_packet_sys_t *p_packetsys, uint8_t i_stream_number,
|
||||
|
@ -601,7 +601,7 @@ static void Packet_UpdateTime( asf_packet_sys_t *p_packetsys, uint8_t i_stream_n
|
|||
{
|
||||
asf_track_t *tk = p_packetsys->p_demux->p_sys->track[i_stream_number];
|
||||
if ( tk )
|
||||
tk->i_time = VLC_TS_0 + i_time;
|
||||
tk->i_time = VLC_TICK_0 + i_time;
|
||||
}
|
||||
|
||||
static asf_track_info_t * Packet_GetTrackInfo( asf_packet_sys_t *p_packetsys,
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -312,7 +312,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 )
|
||||
|
@ -322,7 +322,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 );
|
||||
|
||||
|
|
|
@ -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 *
|
||||
|
|
|
@ -1160,7 +1160,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 */
|
||||
|
@ -1380,7 +1380,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;
|
||||
|
@ -1450,7 +1450,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 *** */
|
||||
|
@ -1550,7 +1550,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 );
|
||||
|
||||
AVI_SendFrame( p_demux, p_stream, p_frame );
|
||||
}
|
||||
|
@ -1716,9 +1716,9 @@ static int Seek( demux_t *p_demux, vlc_tick_t i_date, int i_percent, bool b_accu
|
|||
}
|
||||
}
|
||||
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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -179,7 +179,7 @@ static int Demux( demux_t *p_demux)
|
|||
p_sys->i_state++;
|
||||
/* by default, timestamps are invalid.
|
||||
* Except when we need an anchor point */
|
||||
p_block_in->i_dts = VLC_TS_0;
|
||||
p_block_in->i_dts = VLC_TICK_0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -228,7 +228,7 @@ static int Demux (demux_t *demux)
|
|||
return 0;
|
||||
}
|
||||
|
||||
block->i_pts = block->i_dts = VLC_TS_0 + date_Get (&sys->pts);
|
||||
block->i_pts = block->i_dts = VLC_TICK_0 + date_Get (&sys->pts);
|
||||
es_out_SetPCR (demux->out, block->i_pts);
|
||||
es_out_Send (demux->out, sys->es, block);
|
||||
date_Increment (&sys->pts, SAMPLES);
|
||||
|
|
|
@ -168,7 +168,7 @@ block_t * HLSStream::checkBlock(block_t *p_block, bool b_first)
|
|||
if(mpegts != std::numeric_limits<uint64_t>::max() &&
|
||||
local != std::numeric_limits<mtime_t>::max())
|
||||
{
|
||||
setMetadataTimeMapping(VLC_TS_0 + mpegts * 100/9, VLC_TS_0 + local);
|
||||
setMetadataTimeMapping(VLC_TICK_0 + mpegts * 100/9, VLC_TICK_0 + local);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -390,7 +390,7 @@ void M3U8Parser::parseSegments(vlc_object_t *, HLSRepresentation *rep, const std
|
|||
break;
|
||||
|
||||
case SingleValueTag::EXTXPROGRAMDATETIME:
|
||||
absReferenceTime = VLC_TS_0 +
|
||||
absReferenceTime = VLC_TICK_0 +
|
||||
UTCTime(static_cast<const SingleValueTag *>(tag)->getValue().value).mtime();
|
||||
/* Reverse apply UTC timespec from first discont */
|
||||
if(segmentstoappend.size() && segmentstoappend.back()->getDisplayTime() == VLC_TICK_INVALID)
|
||||
|
@ -399,10 +399,10 @@ void M3U8Parser::parseSegments(vlc_object_t *, HLSRepresentation *rep, const std
|
|||
for(auto it = segmentstoappend.crbegin(); it != segmentstoappend.crend(); ++it)
|
||||
{
|
||||
vlc_tick_t duration = timescale.ToTime((*it)->duration.Get());
|
||||
if( duration < tempTime - VLC_TS_0 )
|
||||
if( duration < tempTime - VLC_TICK_0 )
|
||||
tempTime -= duration;
|
||||
else
|
||||
tempTime = VLC_TS_0;
|
||||
tempTime = VLC_TICK_0;
|
||||
(*it)->setDisplayTime(tempTime);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -220,7 +220,7 @@ static int Demux(demux_t *demux)
|
|||
return -1;
|
||||
|
||||
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);
|
||||
es_out_Send(demux->out, sys->es, data);
|
||||
|
||||
|
@ -264,7 +264,7 @@ static int Control(demux_t *demux, int query, va_list args)
|
|||
return VLC_SUCCESS;
|
||||
}
|
||||
case DEMUX_SET_NEXT_DEMUX_TIME: {
|
||||
int64_t pts_next = VLC_TS_0 + va_arg(args, int64_t);
|
||||
int64_t pts_next = VLC_TICK_0 + va_arg(args, int64_t);
|
||||
if (sys->pts_next <= VLC_TICK_INVALID)
|
||||
sys->pts_origin = pts_next;
|
||||
sys->pts_next = pts_next;
|
||||
|
|
|
@ -309,7 +309,7 @@ static int Open( vlc_object_t * p_this )
|
|||
p_demux->pf_control = Control;
|
||||
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;
|
||||
|
|
|
@ -333,7 +333,7 @@ public:
|
|||
:demuxer(demux)
|
||||
,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)
|
||||
|
|
|
@ -889,9 +889,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;
|
||||
|
||||
|
|
|
@ -751,7 +751,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;
|
||||
|
@ -802,7 +802,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 );
|
||||
|
|
|
@ -439,16 +439,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 )
|
||||
{
|
||||
|
@ -467,9 +467,9 @@ 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_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_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_TICK_0 */;
|
||||
}
|
||||
|
||||
p_current_vchapter = p_cur_vchapter;
|
||||
|
@ -531,7 +531,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 )
|
||||
{
|
||||
demuxer.info.i_update |= INPUT_UPDATE_TITLE | INPUT_UPDATE_SEEKPOINT;
|
||||
|
|
|
@ -279,7 +279,7 @@ static int Demux( demux_t *p_demux )
|
|||
}
|
||||
p_frame->i_buffer = i_read;
|
||||
p_frame->i_dts =
|
||||
p_frame->i_pts = VLC_TS_0 + date_Get( &p_sys->pts );
|
||||
p_frame->i_pts = VLC_TICK_0 + date_Get( &p_sys->pts );
|
||||
|
||||
/* Set PCR */
|
||||
es_out_SetPCR( p_demux->out, p_frame->i_pts );
|
||||
|
|
|
@ -1319,12 +1319,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_demux->p_sys->i_pcr == VLC_TICK_INVALID )
|
||||
{
|
||||
es_out_SetPCR( p_demux->out, VLC_TS_0 + i_current_nzdts );
|
||||
p_demux->p_sys->i_pcr = VLC_TS_0 + i_current_nzdts;
|
||||
es_out_SetPCR( p_demux->out, VLC_TICK_0 + i_current_nzdts );
|
||||
p_demux->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;
|
||||
|
@ -1468,7 +1468,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 );
|
||||
}
|
||||
|
||||
|
@ -1821,7 +1821,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_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;
|
||||
}
|
||||
|
||||
|
@ -4421,17 +4421,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 - i_read );
|
||||
#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 );
|
||||
}
|
||||
|
@ -4462,7 +4462,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 );
|
||||
|
||||
/* Set per track read state */
|
||||
for( unsigned i = 0; i < p_sys->i_tracks; i++ )
|
||||
|
@ -4536,7 +4536,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
|
||||
|
@ -4555,7 +4555,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 );
|
||||
}
|
||||
}
|
||||
|
@ -5071,7 +5071,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;
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
|
@ -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 + 1000000 / p_sys->f_fps;
|
||||
p_block_out->i_dts = VLC_TICK_0 + p_sys->i_pts + 1000000 / 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 )
|
||||
|
@ -502,7 +502,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 */
|
||||
|
||||
|
|
|
@ -351,7 +351,7 @@ static int GenericOpen( demux_t *p_demux, const char *psz_module,
|
|||
}
|
||||
else
|
||||
date_Init( &p_sys->feed_dts, 25000, 1000 );
|
||||
date_Set( &p_sys->feed_dts, VLC_TS_0 );
|
||||
date_Set( &p_sys->feed_dts, VLC_TICK_0 );
|
||||
p_sys->output_dts = p_sys->feed_dts;
|
||||
|
||||
/* Load the mpegvideo packetizer */
|
||||
|
@ -481,7 +481,7 @@ static int Demux( demux_t *p_demux)
|
|||
const vlc_tick_t i_frame_length = p_block_out->i_length;
|
||||
|
||||
/* first output */
|
||||
if( date_Get( &p_sys->output_dts ) == VLC_TS_0 )
|
||||
if( date_Get( &p_sys->output_dts ) == VLC_TICK_0 )
|
||||
es_out_SetPCR( p_demux->out, date_Get( &p_sys->output_dts ) );
|
||||
|
||||
es_out_Send( p_demux->out, p_sys->p_es, p_block_out );
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -582,7 +582,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 &&
|
||||
|
@ -623,7 +623,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 )
|
||||
|
|
|
@ -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)
|
||||
|
||||
static inline int64_t TimeStampWrapAround( int64_t i_first_pcr, int64_t i_time )
|
||||
{
|
||||
|
|
|
@ -1009,7 +1009,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;
|
||||
|
@ -1984,7 +1984,7 @@ static int SeekToTime( demux_t *p_demux, const ts_pmt_t *p_pmt, int64_t i_scaled
|
|||
int64_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;
|
||||
|
@ -2087,7 +2087,7 @@ static int ProbeChunk( demux_t *p_demux, int i_program, bool b_end, int64_t *pi_
|
|||
{
|
||||
p_pmt->pcr.i_first = *pi_pcr;
|
||||
}
|
||||
else if( p_pmt->pcr.i_first_dts < VLC_TS_0 )
|
||||
else if( p_pmt->pcr.i_first_dts < VLC_TICK_0 )
|
||||
{
|
||||
p_pmt->pcr.i_first_dts = FROM_SCALE(*pi_pcr);
|
||||
}
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -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 );
|
||||
|
@ -256,8 +256,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 + 4000000; /* 4s */
|
||||
p_frame->i_pts = VLC_TICK_0 + p_sys->i_pcr;
|
||||
p_frame->i_dts = VLC_TICK_0 + p_sys->i_pcr + 4000000; /* 4s */
|
||||
|
||||
es_out_Send( p_demux->out, p_sys->p_sub, p_frame );
|
||||
}
|
||||
|
@ -277,7 +277,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 );
|
||||
|
@ -314,7 +314,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 );
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -322,7 +322,7 @@ static int Demux( demux_t * p_demux )
|
|||
|
||||
if( i_lastpcr > VLC_TICK_INVALID )
|
||||
{
|
||||
p_sys->i_nzpcr_offset = i_lastpcr - VLC_TS_0;
|
||||
p_sys->i_nzpcr_offset = i_lastpcr - VLC_TICK_0;
|
||||
if( likely( !p_sys->b_slave ) )
|
||||
es_out_SetPCR( p_demux->out, i_lastpcr );
|
||||
}
|
||||
|
@ -420,7 +420,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 ) );
|
||||
}
|
||||
|
||||
|
@ -448,7 +448,7 @@ static int Demux( demux_t * p_demux )
|
|||
const int i_page_packets = ogg_page_packets( &p_sys->current_page );
|
||||
bool b_doprepcr = false;
|
||||
|
||||
if ( p_stream->i_pcr < VLC_TS_0 && ogg_page_granulepos( &p_sys->current_page ) > 0 )
|
||||
if ( p_stream->i_pcr < VLC_TICK_0 && ogg_page_granulepos( &p_sys->current_page ) > 0 )
|
||||
{
|
||||
// PASS 0
|
||||
if ( p_stream->fmt.i_codec == VLC_CODEC_OPUS ||
|
||||
|
@ -595,7 +595,7 @@ static int Demux( demux_t * p_demux )
|
|||
p_block->i_flags |= BLOCK_FLAG_PREROLL;
|
||||
}
|
||||
else
|
||||
p_block->i_pts = VLC_TS_0 + p_sys->i_nzpcr_offset + pagestamp;
|
||||
p_block->i_pts = VLC_TICK_0 + p_sys->i_nzpcr_offset + pagestamp;
|
||||
b_fixed = true;
|
||||
break;
|
||||
default:
|
||||
|
@ -604,7 +604,7 @@ static int Demux( demux_t * p_demux )
|
|||
pagestamp = pagestamp - ( CLOCK_FREQ / p_stream->f_rate );
|
||||
if( pagestamp < 0 )
|
||||
pagestamp = 0;
|
||||
p_block->i_pts = VLC_TS_0 + p_sys->i_nzpcr_offset + pagestamp;
|
||||
p_block->i_pts = VLC_TICK_0 + p_sys->i_nzpcr_offset + pagestamp;
|
||||
b_fixed = true;
|
||||
}
|
||||
}
|
||||
|
@ -614,7 +614,7 @@ static int Demux( demux_t * p_demux )
|
|||
{
|
||||
pagestamp = p_stream->i_previous_pcr; /* as set above */
|
||||
if ( pagestamp < 0 ) pagestamp = 0;
|
||||
p_stream->i_pcr = VLC_TS_0 + pagestamp;
|
||||
p_stream->i_pcr = VLC_TICK_0 + pagestamp;
|
||||
p_stream->i_pcr += p_sys->i_nzpcr_offset;
|
||||
p_stream->i_previous_granulepos = ogg_page_granulepos( &p_sys->current_page );
|
||||
}
|
||||
|
@ -630,7 +630,7 @@ static int Demux( demux_t * p_demux )
|
|||
ogg_page_granulepos( &p_sys->current_page ), false );
|
||||
if ( i_pagestamp > -1 )
|
||||
{
|
||||
p_stream->i_pcr = VLC_TS_0 + i_pagestamp;
|
||||
p_stream->i_pcr = VLC_TICK_0 + i_pagestamp;
|
||||
p_stream->i_pcr += p_sys->i_nzpcr_offset;
|
||||
}
|
||||
|
||||
|
@ -664,13 +664,13 @@ static int Demux( demux_t * p_demux )
|
|||
continue;
|
||||
if( p_stream->fmt.i_codec == VLC_CODEC_OGGSPOTS )
|
||||
continue;
|
||||
if( p_stream->i_pcr < VLC_TS_0 )
|
||||
if( p_stream->i_pcr < VLC_TICK_0 )
|
||||
continue;
|
||||
if ( p_stream->b_finished || p_stream->b_initializing )
|
||||
continue;
|
||||
if ( p_stream->p_preparse_block )
|
||||
continue;
|
||||
if( i_pcr_candidate < VLC_TS_0
|
||||
if( i_pcr_candidate < VLC_TICK_0
|
||||
|| p_stream->i_pcr <= i_pcr_candidate )
|
||||
{
|
||||
i_pcr_candidate = p_stream->i_pcr;
|
||||
|
@ -815,7 +815,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
|
|||
Ogg_ResetStreamsHelper( 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
|
||||
|
@ -883,11 +883,11 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
|
|||
assert( p_sys->i_length > 0 );
|
||||
i64 = p_sys->i_length * f;
|
||||
Ogg_ResetStreamsHelper( 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;
|
||||
}
|
||||
|
||||
|
@ -957,7 +957,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
|
|||
{
|
||||
Ogg_ResetStreamsHelper( p_sys );
|
||||
es_out_Control( p_demux->out, ES_OUT_SET_NEXT_DISPLAY_TIME,
|
||||
VLC_TS_0 + i64 );
|
||||
VLC_TICK_0 + i64 );
|
||||
p_demux->info.i_update |= INPUT_UPDATE_SEEKPOINT;
|
||||
p_demux->info.i_seekpoint = i_seekpoint;
|
||||
return VLC_SUCCESS;
|
||||
|
@ -1018,7 +1018,7 @@ static void Ogg_UpdatePCR( demux_t *p_demux, logical_stream_t *p_stream,
|
|||
if( p_stream->b_oggds && p_oggpacket->bytes > 0 &&
|
||||
(p_oggpacket->packet[0] & PACKET_TYPE_HEADER) == 0 )
|
||||
{
|
||||
p_stream->i_pcr = VLC_TS_0 + p_ogg->i_nzpcr_offset;
|
||||
p_stream->i_pcr = VLC_TICK_0 + p_ogg->i_nzpcr_offset;
|
||||
}
|
||||
}
|
||||
else if( p_oggpacket->granulepos > 0 )
|
||||
|
@ -1032,7 +1032,7 @@ static void Ogg_UpdatePCR( demux_t *p_demux, logical_stream_t *p_stream,
|
|||
p_stream->fmt.i_codec == VLC_CODEC_OGGSPOTS ||
|
||||
(p_stream->b_oggds && p_stream->fmt.i_cat == VIDEO_ES) )
|
||||
{
|
||||
p_stream->i_pcr = VLC_TS_0 + Oggseek_GranuleToAbsTimestamp( p_stream,
|
||||
p_stream->i_pcr = VLC_TICK_0 + Oggseek_GranuleToAbsTimestamp( p_stream,
|
||||
p_oggpacket->granulepos, true );
|
||||
p_stream->i_pcr += p_ogg->i_nzpcr_offset;
|
||||
}
|
||||
|
@ -1059,7 +1059,7 @@ static void Ogg_UpdatePCR( demux_t *p_demux, logical_stream_t *p_stream,
|
|||
else
|
||||
sample = 0;
|
||||
|
||||
p_stream->i_pcr = VLC_TS_0 + sample * CLOCK_FREQ / p_stream->f_rate;
|
||||
p_stream->i_pcr = VLC_TICK_0 + sample * CLOCK_FREQ / p_stream->f_rate;
|
||||
p_stream->i_pcr += p_ogg->i_nzpcr_offset;
|
||||
}
|
||||
|
||||
|
@ -1073,13 +1073,13 @@ static void Ogg_UpdatePCR( demux_t *p_demux, logical_stream_t *p_stream,
|
|||
{
|
||||
if( p_stream->i_previous_granulepos > 0 )
|
||||
{
|
||||
p_stream->i_pcr = VLC_TS_0 + Oggseek_GranuleToAbsTimestamp( p_stream, ++p_stream->i_previous_granulepos, false );
|
||||
p_stream->i_pcr = VLC_TICK_0 + Oggseek_GranuleToAbsTimestamp( p_stream, ++p_stream->i_previous_granulepos, false );
|
||||
p_stream->i_pcr += p_ogg->i_nzpcr_offset;
|
||||
}
|
||||
/* First frame in ogm can be -1 (0 0 -1 2 3 -1 5 ...) */
|
||||
else if( p_stream->i_previous_granulepos == 0 )
|
||||
{
|
||||
p_stream->i_pcr = VLC_TS_0 + p_ogg->i_nzpcr_offset;
|
||||
p_stream->i_pcr = VLC_TICK_0 + p_ogg->i_nzpcr_offset;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1112,7 +1112,7 @@ static void Ogg_UpdatePCR( demux_t *p_demux, logical_stream_t *p_stream,
|
|||
i_duration = p_stream->special.speex.i_framesize *
|
||||
p_stream->special.speex.i_framesperpacket;
|
||||
p_oggpacket->granulepos = p_stream->i_previous_granulepos + i_duration;
|
||||
p_stream->i_pcr = VLC_TS_0 + Oggseek_GranuleToAbsTimestamp( p_stream,
|
||||
p_stream->i_pcr = VLC_TICK_0 + Oggseek_GranuleToAbsTimestamp( p_stream,
|
||||
p_stream->i_previous_granulepos, false );
|
||||
p_stream->i_pcr += p_ogg->i_nzpcr_offset;
|
||||
}
|
||||
|
@ -1129,7 +1129,7 @@ static void Ogg_UpdatePCR( demux_t *p_demux, logical_stream_t *p_stream,
|
|||
else
|
||||
sample = 0;
|
||||
|
||||
p_stream->i_pcr = VLC_TS_0 + sample * CLOCK_FREQ / p_stream->f_rate;
|
||||
p_stream->i_pcr = VLC_TICK_0 + sample * CLOCK_FREQ / p_stream->f_rate;
|
||||
p_stream->i_pcr += p_ogg->i_nzpcr_offset;
|
||||
}
|
||||
else if( p_stream->fmt.i_cat == VIDEO_ES && p_stream->i_pcr > VLC_TS_UNKNOWN )
|
||||
|
@ -1173,25 +1173,25 @@ static void Ogg_SendOrQueueBlocks( demux_t *p_demux, logical_stream_t *p_stream,
|
|||
block_t *temp = p_stream->p_preparse_block;
|
||||
while ( temp )
|
||||
{
|
||||
if ( temp && i_firstpts < VLC_TS_0 )
|
||||
if ( temp && i_firstpts < VLC_TICK_0 )
|
||||
i_firstpts = temp->i_pts;
|
||||
|
||||
block_t *tosend = temp;
|
||||
temp = temp->p_next;
|
||||
tosend->p_next = NULL;
|
||||
|
||||
if( tosend->i_dts < VLC_TS_0 )
|
||||
if( tosend->i_dts < VLC_TICK_0 )
|
||||
{
|
||||
tosend->i_dts = tosend->i_pts;
|
||||
}
|
||||
|
||||
if( tosend->i_dts < VLC_TS_0 )
|
||||
if( tosend->i_dts < VLC_TICK_0 )
|
||||
{
|
||||
/* Don't send metadata from chained streams */
|
||||
block_Release( tosend );
|
||||
continue;
|
||||
}
|
||||
else if( tosend->i_dts < VLC_TS_0 )
|
||||
else if( tosend->i_dts < VLC_TICK_0 )
|
||||
{
|
||||
tosend->i_dts = tosend->i_pts;
|
||||
}
|
||||
|
@ -1200,7 +1200,7 @@ static void Ogg_SendOrQueueBlocks( demux_t *p_demux, logical_stream_t *p_stream,
|
|||
tosend->i_dts, tosend->i_pts, p_stream->i_pcr, p_ogg->i_pcr ); )
|
||||
es_out_Send( p_demux->out, p_stream->p_es, tosend );
|
||||
|
||||
if ( p_ogg->i_pcr < VLC_TS_0 && i_firstpts > VLC_TICK_INVALID )
|
||||
if ( p_ogg->i_pcr < VLC_TICK_0 && i_firstpts > VLC_TICK_INVALID )
|
||||
{
|
||||
p_ogg->i_pcr = i_firstpts;
|
||||
if( likely( !p_ogg->b_slave ) )
|
||||
|
@ -1450,8 +1450,8 @@ static void Ogg_DecodePacket( demux_t *p_demux,
|
|||
{
|
||||
ogg_int64_t nzdts = Oggseek_GranuleToAbsTimestamp( p_stream, p_oggpacket->granulepos, false );
|
||||
ogg_int64_t nzpts = Oggseek_GranuleToAbsTimestamp( p_stream, p_oggpacket->granulepos, true );
|
||||
p_block->i_dts = ( nzdts > VLC_TICK_INVALID ) ? VLC_TS_0 + nzdts : nzdts;
|
||||
p_block->i_pts = ( nzpts > VLC_TICK_INVALID ) ? VLC_TS_0 + nzpts : nzpts;
|
||||
p_block->i_dts = ( nzdts > VLC_TICK_INVALID ) ? VLC_TICK_0 + nzdts : nzdts;
|
||||
p_block->i_pts = ( nzpts > VLC_TICK_INVALID ) ? VLC_TICK_0 + nzpts : nzpts;
|
||||
/* granulepos for dirac is possibly broken, this value should be ignored */
|
||||
if( 0 >= p_oggpacket->granulepos )
|
||||
{
|
||||
|
|
|
@ -234,7 +234,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;
|
||||
|
@ -445,9 +445,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 )
|
||||
|
|
|
@ -251,7 +251,7 @@ static int Demux( demux_t *p_demux )
|
|||
return 0;
|
||||
}
|
||||
|
||||
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 );
|
||||
|
||||
es_out_SetPCR( p_demux->out, p_block->i_pts );
|
||||
es_out_Send( p_demux->out, p_sys->p_es, p_block );
|
||||
|
|
|
@ -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 )
|
||||
{
|
||||
|
@ -278,7 +278,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 )
|
||||
{
|
||||
|
|
|
@ -395,7 +395,7 @@ static int Demux( demux_t *p_demux )
|
|||
vlc_tick_t i_pcr = date_Get( &p_sys->pcr );
|
||||
|
||||
/* Call the pace control */
|
||||
es_out_SetPCR( p_demux->out, VLC_TS_0 + i_pcr );
|
||||
es_out_SetPCR( p_demux->out, VLC_TICK_0 + i_pcr );
|
||||
|
||||
if( p_sys->b_y4m )
|
||||
{
|
||||
|
@ -421,7 +421,7 @@ static int Demux( demux_t *p_demux )
|
|||
return 0;
|
||||
}
|
||||
|
||||
p_block->i_dts = p_block->i_pts = VLC_TS_0 + i_pcr;
|
||||
p_block->i_dts = p_block->i_pts = VLC_TICK_0 + i_pcr;
|
||||
es_out_Send( p_demux->out, p_sys->p_es_video, p_block );
|
||||
|
||||
date_Increment( &p_sys->pcr, 1 );
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
|
@ -218,7 +218,7 @@ static int Demux (demux_t *demux)
|
|||
return 0;
|
||||
}
|
||||
block->i_buffer = i_read;
|
||||
block->i_pts = block->i_dts = VLC_TS_0 + date_Get (&sys->pts);
|
||||
block->i_pts = block->i_dts = VLC_TICK_0 + date_Get (&sys->pts);
|
||||
|
||||
es_out_SetPCR (demux->out, block->i_pts);
|
||||
|
||||
|
|
|
@ -372,9 +372,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++)
|
||||
{
|
||||
|
@ -489,7 +489,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;
|
||||
}
|
||||
|
||||
|
@ -508,7 +508,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:
|
||||
|
@ -517,7 +517,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));
|
||||
|
|
|
@ -183,7 +183,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;
|
||||
}
|
||||
|
||||
|
@ -197,7 +197,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);
|
||||
|
@ -213,7 +213,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;
|
||||
}
|
||||
|
||||
|
|
|
@ -816,14 +816,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, int64_t ) - VLC_TS_0;
|
||||
p_sys->i_next_demux_date = va_arg( args, int64_t ) - VLC_TICK_0;
|
||||
return VLC_SUCCESS;
|
||||
|
||||
case DEMUX_GET_PTS_DELAY:
|
||||
|
@ -858,7 +858,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;
|
||||
}
|
||||
|
||||
|
@ -868,7 +868,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;
|
||||
|
||||
|
@ -881,7 +881,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;
|
||||
}
|
||||
|
||||
|
@ -2433,7 +2433,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;
|
||||
|
||||
|
|
|
@ -207,7 +207,7 @@ static int Demux( demux_t *p_demux )
|
|||
p_data = vlc_stream_Block( p_demux->s,
|
||||
p_sys->pi_seektable[p_sys->i_currentframe] );
|
||||
if( p_data == NULL ) return 0;
|
||||
p_data->i_dts = p_data->i_pts = VLC_TS_0 + (int64_t)(INT64_C(1000000) * p_sys->i_currentframe) * TTA_FRAMETIME;
|
||||
p_data->i_dts = p_data->i_pts = VLC_TICK_0 + (int64_t)(INT64_C(1000000) * p_sys->i_currentframe) * TTA_FRAMETIME;
|
||||
|
||||
p_sys->i_currentframe++;
|
||||
|
||||
|
|
|
@ -238,7 +238,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;
|
||||
|
@ -365,7 +365,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;
|
||||
}
|
||||
|
||||
|
@ -383,7 +383,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 );
|
||||
|
@ -395,7 +395,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;
|
||||
}
|
||||
|
||||
|
|
|
@ -628,7 +628,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;
|
||||
|
@ -691,7 +691,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 );*/
|
||||
|
@ -868,7 +868,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;
|
||||
}
|
||||
|
@ -907,7 +907,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;
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
|
@ -411,7 +411,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 );
|
||||
|
|
|
@ -511,7 +511,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 );
|
||||
|
|
|
@ -474,7 +474,7 @@ static int Demux( demux_t *p_demux )
|
|||
}
|
||||
|
||||
p_block->i_dts =
|
||||
p_block->i_pts = VLC_TS_0 + date_Get( &p_sys->pts );
|
||||
p_block->i_pts = VLC_TICK_0 + date_Get( &p_sys->pts );
|
||||
|
||||
/* set PCR */
|
||||
es_out_SetPCR( p_demux->out, p_block->i_pts );
|
||||
|
|
|
@ -277,16 +277,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 );
|
||||
|
@ -497,7 +497,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, int64_t ) - VLC_TS_0;
|
||||
p_sys->i_next_demux_time = va_arg( args, int64_t ) - VLC_TICK_0;
|
||||
return VLC_SUCCESS;
|
||||
|
||||
case DEMUX_GET_PTS_DELAY:
|
||||
|
@ -564,7 +564,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 )
|
||||
{
|
||||
|
@ -591,7 +591,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;
|
||||
}
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ static int Open( vlc_object_t * p_this )
|
|||
p_sys->p_es = 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 );
|
||||
|
||||
p_demux->pf_demux = Demux;
|
||||
p_demux->pf_control = Control;
|
||||
|
|
|
@ -290,10 +290,10 @@ static inline int FLAC_ParseSyncInfo(const uint8_t *p_buf, unsigned i_buf,
|
|||
if ( (p_buf[1] & 0x01) == 0 ) /* Fixed blocksize stream / Frames */
|
||||
{
|
||||
const unsigned fixedblocksize = stream_info ? stream_info->min_blocksize : blocksize;
|
||||
h->i_pts = VLC_TS_0 + CLOCK_FREQ * fixedblocksize * i_fsnumber / samplerate;
|
||||
h->i_pts = VLC_TICK_0 + CLOCK_FREQ * fixedblocksize * 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;
|
||||
|
|
|
@ -437,7 +437,7 @@ static block_t *OutputFrame( decoder_t *p_dec )
|
|||
{
|
||||
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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_picture)
|
|||
/* If input picture doesn't have actual valid timestamp,
|
||||
we don't really have currently a way to know what else
|
||||
to do with it other than drop it for now*/
|
||||
if( unlikely( p_picture->date < VLC_TS_0) )
|
||||
if( unlikely( p_picture->date < VLC_TICK_0) )
|
||||
{
|
||||
msg_Dbg( p_filter, "skipping non-dated picture");
|
||||
picture_Release( p_picture );
|
||||
|
|
|
@ -360,7 +360,7 @@ int aout_DecPlay (audio_output_t *aout, block_t *block, int input_rate)
|
|||
|
||||
assert (input_rate >= INPUT_RATE_DEFAULT / AOUT_MAX_INPUT_RATE);
|
||||
assert (input_rate <= INPUT_RATE_DEFAULT * AOUT_MAX_INPUT_RATE);
|
||||
assert (block->i_pts >= VLC_TS_0);
|
||||
assert (block->i_pts >= VLC_TICK_0);
|
||||
|
||||
block->i_length = CLOCK_FREQ * block->i_nb_samples
|
||||
/ owner->input_format.i_rate;
|
||||
|
|
|
@ -74,7 +74,7 @@ static void* Thread( void* data )
|
|||
vlc_array_remove( &worker->tail.data, 0 );
|
||||
}
|
||||
|
||||
if( worker->head.deadline == VLC_TS_0 && item == NULL )
|
||||
if( worker->head.deadline == VLC_TICK_0 && item == NULL )
|
||||
worker->head.active = false;
|
||||
worker->head.id = item ? item->id : NULL;
|
||||
vlc_cond_broadcast( &worker->head.wait );
|
||||
|
@ -86,7 +86,7 @@ static void* Thread( void* data )
|
|||
else
|
||||
worker->head.deadline = INT64_MAX;
|
||||
}
|
||||
else if( worker->head.deadline != VLC_TS_0 )
|
||||
else if( worker->head.deadline != VLC_TICK_0 )
|
||||
{
|
||||
/* Wait 1 seconds for new inputs before terminating */
|
||||
vlc_tick_t deadline = mdate() + INT64_C(1000000);
|
||||
|
@ -96,7 +96,7 @@ static void* Thread( void* data )
|
|||
{
|
||||
/* Timeout: if there is still no items, the thread will be
|
||||
* terminated at next loop iteration (active = false). */
|
||||
worker->head.deadline = VLC_TS_0;
|
||||
worker->head.deadline = VLC_TICK_0;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ static void BackgroundWorkerCancel( struct background_worker* worker, void* id)
|
|||
while( ( id == NULL && worker->head.active )
|
||||
|| ( id != NULL && worker->head.id == id ) )
|
||||
{
|
||||
worker->head.deadline = VLC_TS_0;
|
||||
worker->head.deadline = VLC_TICK_0;
|
||||
vlc_cond_signal( &worker->head.worker_wait );
|
||||
vlc_cond_signal( &worker->tail.wait );
|
||||
vlc_cond_wait( &worker->head.wait, &worker->lock );
|
||||
|
|
Loading…
Reference in New Issue