Commit b4dfbc62 authored by Steve Lhomme's avatar Steve Lhomme

rename mdate() to vlc_tick_now()

The lua "mdate" remains the same.
parent 8b0c6bb9
......@@ -175,7 +175,7 @@ struct audio_output
* clock and the media upstream clock (if any).
*
* If the audio output clock is exactly synchronized with the system
* monotonic clock (i.e. mdate()), then aout_TimeGetDefault() can
* monotonic clock (i.e. vlc_tick_now()), then aout_TimeGetDefault() can
* implement this callback.
*
* \param delay pointer to the delay until the next sample to be written
......
......@@ -430,7 +430,7 @@ static inline int decoder_GetInputAttachments( decoder_t *dec,
/**
* This function converts a decoder timestamp into a display date comparable
* to mdate().
* to vlc_tick_now().
* You MUST use it *only* for gathering statistics about speed.
*/
VLC_USED
......
......@@ -84,7 +84,7 @@ VLC_API int vlc_mwait_i11e(vlc_tick_t);
*/
static inline int vlc_msleep_i11e(vlc_tick_t delay)
{
return vlc_mwait_i11e(mdate() + delay);
return vlc_mwait_i11e(vlc_tick_now() + delay);
}
/**
......
......@@ -521,7 +521,7 @@ VLC_API void vlc_cond_wait(vlc_cond_t *cond, vlc_mutex_t *mutex);
*
* This works like vlc_cond_wait() but with an additional time-out.
* The time-out is expressed as an absolute timestamp using the same arbitrary
* time reference as the mdate() and vlc_tick_wait() functions.
* time reference as the vlc_tick_now() and vlc_tick_wait() functions.
*
* \note This function is a cancellation point. In case of thread cancellation,
* the mutex is always locked before cancellation proceeds.
......@@ -534,7 +534,7 @@ VLC_API void vlc_cond_wait(vlc_cond_t *cond, vlc_mutex_t *mutex);
* \warning If the variable was initialized with vlc_cond_init_daytime(), or
* was statically initialized with \ref VLC_STATIC_COND, the time reference
* used by this function is unspecified (depending on the implementation, it
* might be the Unix epoch or the mdate() clock).
* might be the Unix epoch or the vlc_tick_now() clock).
*
* \return 0 if the condition was signaled, an error code in case of timeout.
*/
......@@ -842,12 +842,12 @@ VLC_API unsigned long vlc_thread_id(void) VLC_USED;
*
* \return a timestamp in microseconds.
*/
VLC_API vlc_tick_t mdate(void);
VLC_API vlc_tick_t vlc_tick_now(void);
/**
* Waits until a deadline.
*
* \param deadline timestamp to wait for (\ref mdate())
* \param deadline timestamp to wait for (\ref vlc_tick_now())
*
* \note The deadline may be exceeded due to OS scheduling.
* \note This function is a cancellation point.
......@@ -959,7 +959,7 @@ VLC_API void vlc_timer_destroy(vlc_timer_t timer);
* timer is still running. See also vlc_timer_getoverrun().
*
* \param timer initialized timer
* \param absolute the timer value origin is the same as mdate() if true,
* \param absolute the timer value origin is the same as vlc_tick_now() if true,
* the timer value is relative to now if false.
* \param value zero to disarm the timer, otherwise the initial time to wait
* before firing the timer.
......
......@@ -238,7 +238,7 @@ libvlc_module_description_t *libvlc_video_filter_list_get( libvlc_instance_t *p_
int64_t libvlc_clock(void)
{
return mdate();
return vlc_tick_now();
}
const char vlc_module_name[] = "libvlc";
......@@ -182,7 +182,7 @@ static void *Thread (void *data)
vlc_tick_t pts;
frames = snd_pcm_readi (pcm, block->p_buffer, sys->period_size);
pts = mdate ();
pts = vlc_tick_now ();
if (frames < 0)
{
block_Release (block);
......@@ -242,7 +242,7 @@ static int Control (demux_t *demux, int query, va_list ap)
switch (query)
{
case DEMUX_GET_TIME:
*va_arg (ap, int64_t *) = mdate () - sys->start;
*va_arg (ap, int64_t *) = vlc_tick_now () - sys->start;
break;
case DEMUX_GET_PTS_DELAY:
......@@ -458,7 +458,7 @@ static int Open (vlc_object_t *obj)
fmt.audio.i_rate = param;
sys->rate = param;
sys->start = mdate ();
sys->start = vlc_tick_now ();
sys->caching = INT64_C(1000) * var_InheritInteger (demux, "live-caching");
param = sys->caching;
val = snd_pcm_hw_params_set_buffer_time_near (pcm, hw, &param, NULL);
......
......@@ -456,7 +456,7 @@ static int Control(demux_t *p_demux, int i_query, va_list args)
case DEMUX_GET_TIME:
pi64 = va_arg(args, int64_t *);
*pi64 = mdate();
*pi64 = vlc_tick_now();
return VLC_SUCCESS;
default:
......
......@@ -414,7 +414,7 @@ static void startBackground(demux_t *p_demux)
}
// XXX TODO: what would be correct timestamp ???
p_block->i_dts = p_block->i_pts = mdate() + CLOCK_FREQ/25;
p_block->i_dts = p_block->i_pts = vlc_tick_now() + CLOCK_FREQ/25;
uint8_t *p = p_block->p_buffer;
memset(p, 0, fmt.video.i_width * fmt.video.i_height);
......@@ -1634,7 +1634,7 @@ static void bluraySendOverlayToVout(demux_t *p_demux, bluray_overlay_t *p_ov)
return;
}
p_pic->i_start = p_pic->i_stop = mdate();
p_pic->i_start = p_pic->i_stop = vlc_tick_now();
p_pic->i_channel = vout_RegisterSubpictureChannel(p_sys->p_vout);
p_ov->i_channel = p_pic->i_channel;
......@@ -2189,7 +2189,7 @@ static void blurayStillImage( demux_t *p_demux, unsigned i_timeout )
demux_sys_t *p_sys = p_demux->p_sys;
/* time period elapsed ? */
if (p_sys->i_still_end_time > 0 && p_sys->i_still_end_time <= mdate()) {
if (p_sys->i_still_end_time > 0 && p_sys->i_still_end_time <= vlc_tick_now()) {
msg_Dbg(p_demux, "Still image end");
bd_read_skip_still(p_sys->bluray);
......@@ -2201,7 +2201,7 @@ static void blurayStillImage( demux_t *p_demux, unsigned i_timeout )
if (!p_sys->i_still_end_time) {
if (i_timeout) {
msg_Dbg(p_demux, "Still image (%d seconds)", i_timeout);
p_sys->i_still_end_time = mdate() + i_timeout * CLOCK_FREQ;
p_sys->i_still_end_time = vlc_tick_now() + i_timeout * CLOCK_FREQ;
} else {
msg_Dbg(p_demux, "Still image (infinite)");
p_sys->i_still_end_time = -1;
......
......@@ -452,7 +452,7 @@ static block_t *GrabVideo( demux_t *p_demux )
memcpy( p_block->p_buffer, (const char *)p_sys->frame->image,
p_sys->width * p_sys->height * 2 );
p_block->i_pts = p_block->i_dts = mdate();
p_block->i_pts = p_block->i_dts = vlc_tick_now();
dc1394_capture_enqueue( p_sys->camera, p_sys->frame );
return p_block;
}
......@@ -502,7 +502,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
return VLC_SUCCESS;
case DEMUX_GET_TIME:
*va_arg( args, int64_t * ) = mdate();
*va_arg( args, int64_t * ) = vlc_tick_now();
return VLC_SUCCESS;
/* TODO implement others */
......
......@@ -773,7 +773,7 @@ static int DemuxOpen( vlc_object_t *p_this )
p_stream->p_es = es_out_Add( p_demux->out, &fmt );
}
p_sys->i_start = mdate();
p_sys->i_start = vlc_tick_now();
return VLC_SUCCESS;
}
......@@ -1988,7 +1988,7 @@ static int DemuxControl( demux_t *p_demux, int i_query, va_list args )
case DEMUX_GET_TIME:
pi64 = va_arg( args, int64_t * );
*pi64 = mdate() - p_sys->i_start;
*pi64 = vlc_tick_now() - p_sys->i_start;
return VLC_SUCCESS;
/* TODO implement others */
......
......@@ -638,7 +638,7 @@ STDMETHODIMP CapturePin::Receive( IMediaSample *pSample )
msg_Dbg( p_input, "CapturePin::Receive" );
#endif
vlc_tick_t i_timestamp = mdate() * 10;
vlc_tick_t i_timestamp = vlc_tick_now() * 10;
VLCMediaSample vlc_sample = {pSample, i_timestamp};
vlc_mutex_lock( &p_sys->lock );
......
......@@ -340,7 +340,7 @@ ssize_t BDAOutput::Pop(void *buf, size_t len, int ms)
vlc_mutex_locker l( &lock );
vlc_tick_t i_deadline = mdate() + ms * 1000;
vlc_tick_t i_deadline = vlc_tick_now() + ms * 1000;
while( !p_first )
{
if( vlc_cond_timedwait( &wait, &lock, i_deadline ) )
......
......@@ -1439,7 +1439,7 @@ static void DateTimeSend( cam_t * p_cam, int i_session_id )
APDUSend( p_cam, i_session_id, AOT_DATE_TIME, p_response, 7 );
p_date->i_last = mdate();
p_date->i_last = vlc_tick_now();
}
}
......@@ -1488,7 +1488,7 @@ static void DateTimeManage( cam_t * p_cam, int i_session_id )
(date_time_t *)p_cam->p_sessions[i_session_id - 1].p_sys;
if ( p_date->i_interval
&& mdate() > p_date->i_last + (vlc_tick_t)p_date->i_interval * CLOCK_FREQ )
&& vlc_tick_now() > p_date->i_last + (vlc_tick_t)p_date->i_interval * CLOCK_FREQ )
{
DateTimeSend( p_cam, i_session_id );
}
......@@ -2030,7 +2030,7 @@ void en50221_Poll( cam_t * p_cam )
switch( p_cam->i_ca_type )
{
case CA_CI_LINK:
if( mdate() > p_cam->i_next_event )
if( vlc_tick_now() > p_cam->i_next_event )
break;
case CA_CI:
return;
......@@ -2168,7 +2168,7 @@ void en50221_Poll( cam_t * p_cam )
}
}
p_cam->i_next_event = mdate() + p_cam->i_timeout;
p_cam->i_next_event = vlc_tick_now() + p_cam->i_timeout;
}
......
......@@ -389,7 +389,7 @@ Raw1394Handler(raw1394handle_t handle, unsigned char *data,
if( p_sys->p_ev->p_frame )
{
/* Push current frame to p_access thread. */
//p_sys->p_ev->p_frame->i_pts = mdate();
//p_sys->p_ev->p_frame->i_pts = vlc_tick_now();
block_ChainAppend( &p_sys->p_frame, p_sys->p_ev->p_frame );
}
/* reset list */
......
......@@ -292,7 +292,7 @@ static int ScanReadCallback( scan_t *p_scan, void *p_privdata,
FrontendGetStatus( &p_sys->dvb, &status );
bool b_has_lock = status.b_has_lock;
vlc_tick_t i_scan_start = mdate();
vlc_tick_t i_scan_start = vlc_tick_now();
for( ; *pi_count == 0; )
{
......@@ -304,7 +304,7 @@ static int ScanReadCallback( scan_t *p_scan, void *p_privdata,
do
{
vlc_tick_t i_poll_timeout = i_scan_start - mdate() + i_timeout;
vlc_tick_t i_poll_timeout = i_scan_start - vlc_tick_now() + i_timeout;
i_ret = 0;
......@@ -332,7 +332,7 @@ static int ScanReadCallback( scan_t *p_scan, void *p_privdata,
FrontendGetStatus( &p_sys->dvb, &status );
if( status.b_has_lock && !b_has_lock )
{
i_scan_start = mdate();
i_scan_start = vlc_tick_now();
b_has_lock = true;
}
}
......
......@@ -421,7 +421,7 @@ scan_t *scan_New( vlc_object_t *p_obj, const scan_parameter_t *p_parameter,
p_scan->b_multiplexes_from_nit = false;
scan_parameter_Init( &p_scan->parameter );
scan_parameter_Copy( p_parameter, &p_scan->parameter );
p_scan->i_time_start = mdate();
p_scan->i_time_start = vlc_tick_now();
p_scan->p_scanlist = NULL;
p_scan->i_scanlist = 0;
......@@ -812,7 +812,7 @@ static int scan_Next( scan_t *p_scan, scan_tuner_config_t *p_cfg )
//while( !scan_tuner_config_ParametersValidate( &p_scan->parameter, p_cfg ) );
const size_t i_total_services = scan_CountServices( p_scan );
const vlc_tick_t i_eta = f_position > 0.005 ? (mdate() - p_scan->i_time_start) * ( 1.0 / f_position - 1.0 ) : -1;
const vlc_tick_t i_eta = f_position > 0.005 ? (vlc_tick_now() - p_scan->i_time_start) * ( 1.0 / f_position - 1.0 ) : -1;
char psz_eta[MSTRTIME_MAX_SIZE];
const char *psz_fmt = _("%.1f MHz (%d services)\n~%s remaining");
......@@ -871,12 +871,12 @@ int scan_Run( scan_t *p_scan )
/* */
uint8_t packet[TS_PACKET_SIZE * SCAN_READ_BUFFER_COUNT];
int64_t i_scan_start = mdate();
int64_t i_scan_start = vlc_tick_now();
for( ;; )
{
unsigned i_timeout = scan_session_GetTablesTimeout( session );
vlc_tick_t i_remaining = mdate() - i_scan_start;
vlc_tick_t i_remaining = vlc_tick_now() - i_scan_start;
if( i_remaining > i_timeout )
break;
......
......@@ -69,7 +69,7 @@ typedef struct
static int DemuxPause( demux_t *demux )
{
demux_sys_t *p_sys = demux->p_sys;
vlc_tick_t now = mdate();
vlc_tick_t now = vlc_tick_now();
if( now >= p_sys->end )
return 0;
......@@ -88,7 +88,7 @@ static int ControlPause( demux_t *demux, int query, va_list args )
{
double *ppos = va_arg( args, double * );
double pos;
vlc_tick_t now = mdate();
vlc_tick_t now = vlc_tick_now();
pos = 1. + ((double)(now - p_sys->end) / (double)p_sys->length);
*ppos = (pos <= 1.) ? pos : 1.;
......@@ -98,7 +98,7 @@ static int ControlPause( demux_t *demux, int query, va_list args )
case DEMUX_SET_POSITION:
{
double pos = va_arg( args, double );
vlc_tick_t now = mdate();
vlc_tick_t now = vlc_tick_now();
p_sys->end = now + (p_sys->length * (1. - pos));
break;
......@@ -114,14 +114,14 @@ static int ControlPause( demux_t *demux, int query, va_list args )
case DEMUX_GET_TIME:
{
vlc_tick_t *ppos = va_arg( args, vlc_tick_t * );
*ppos = mdate() + p_sys->length - p_sys->end;
*ppos = vlc_tick_now() + p_sys->length - p_sys->end;
break;
}
case DEMUX_SET_TIME:
{
vlc_tick_t pos = va_arg( args, vlc_tick_t );
p_sys->end = mdate() + p_sys->length - pos;
p_sys->end = vlc_tick_now() + p_sys->length - pos;
break;
}
......@@ -188,7 +188,7 @@ nop:
if( p_sys == NULL )
return VLC_ENOMEM;
p_sys->end = mdate() + length;
p_sys->end = vlc_tick_now() + length;
p_sys->length = length;
p_demux->p_sys = p_sys;
......
......@@ -223,7 +223,7 @@ static int DemuxOpen( vlc_object_t *p_this )
return VLC_ENOMEM;
p_sys->i_state = STATE_NOSYNC;
p_sys->i_last_state_change = mdate();
p_sys->i_last_state_change = vlc_tick_now();
/* SDI AR */
unsigned int i_num, i_den;
......@@ -1416,10 +1416,10 @@ static int HandleSDBuffer( demux_t *p_demux, uint8_t *p_buffer,
const uint8_t *p_line;
if ( p_sys->i_state != STATE_SYNC
&& p_sys->i_last_state_change < mdate() - RESYNC_TIMEOUT )
&& p_sys->i_last_state_change < vlc_tick_now() - RESYNC_TIMEOUT )
{
p_sys->i_state = STATE_NOSYNC;
p_sys->i_last_state_change = mdate();
p_sys->i_last_state_change = vlc_tick_now();
return VLC_EGENERIC;
}
......@@ -1431,7 +1431,7 @@ static int HandleSDBuffer( demux_t *p_demux, uint8_t *p_buffer,
if ( p_parser == NULL )
break;
p_sys->i_state = STATE_STARTSYNC;
p_sys->i_last_state_change = mdate();
p_sys->i_last_state_change = vlc_tick_now();
case STATE_STARTSYNC:
p_parser = FindReferenceCode( FIELD_1_VBLANK_EAV, p_parser, p_end );
......@@ -1439,7 +1439,7 @@ static int HandleSDBuffer( demux_t *p_demux, uint8_t *p_buffer,
break;
p_sys->i_anc_size = 0;
p_sys->i_state = STATE_ANCSYNC;
p_sys->i_last_state_change = mdate();
p_sys->i_last_state_change = vlc_tick_now();
case STATE_ANCSYNC:
p_parser = CountReference( &p_sys->i_anc_size,
......@@ -1448,7 +1448,7 @@ static int HandleSDBuffer( demux_t *p_demux, uint8_t *p_buffer,
break;
p_sys->i_active_size = 0;
p_sys->i_state = STATE_LINESYNC;
p_sys->i_last_state_change = mdate();
p_sys->i_last_state_change = vlc_tick_now();
case STATE_LINESYNC:
p_parser = CountReference( &p_sys->i_active_size,
......@@ -1457,7 +1457,7 @@ static int HandleSDBuffer( demux_t *p_demux, uint8_t *p_buffer,
break;
p_sys->i_picture_size = p_sys->i_anc_size + p_sys->i_active_size;
p_sys->i_state = STATE_ACTIVESYNC;
p_sys->i_last_state_change = mdate();
p_sys->i_last_state_change = vlc_tick_now();
case STATE_ACTIVESYNC:
p_parser = CountReference( &p_sys->i_picture_size,
......@@ -1467,7 +1467,7 @@ static int HandleSDBuffer( demux_t *p_demux, uint8_t *p_buffer,
p_sys->i_line_offset = p_sys->i_picture_size
/ (p_sys->i_anc_size + p_sys->i_active_size);
p_sys->i_state = STATE_VBLANKSYNC;
p_sys->i_last_state_change = mdate();
p_sys->i_last_state_change = vlc_tick_now();
case STATE_VBLANKSYNC:
p_parser = CountReference( &p_sys->i_picture_size,
......@@ -1475,7 +1475,7 @@ static int HandleSDBuffer( demux_t *p_demux, uint8_t *p_buffer,
if ( p_parser == NULL )
break;
p_sys->i_state = STATE_PICSYNC;
p_sys->i_last_state_change = mdate();
p_sys->i_last_state_change = vlc_tick_now();
case STATE_PICSYNC:
p_parser = CountReference( &p_sys->i_picture_size,
......@@ -1490,7 +1490,7 @@ static int HandleSDBuffer( demux_t *p_demux, uint8_t *p_buffer,
p_sys->i_anc_size, p_sys->i_active_size,
p_sys->i_picture_size, p_sys->i_line_offset + 1 );
p_sys->i_state = STATE_NOSYNC;
p_sys->i_last_state_change = mdate();
p_sys->i_last_state_change = vlc_tick_now();
break;
}
......@@ -1552,7 +1552,7 @@ static int HandleSDBuffer( demux_t *p_demux, uint8_t *p_buffer,
p_sys->i_current_line + 1, p_line[4], p_line[anc+4] );
StopDecode( p_demux );
p_sys->i_state = STATE_NOSYNC;
p_sys->i_last_state_change = mdate();
p_sys->i_last_state_change = vlc_tick_now();
break;
}
......
......@@ -224,7 +224,7 @@ static int DemuxControl( demux_t *p_demux, int i_query, va_list args )
case DEMUX_GET_TIME:
pi64 = va_arg( args, int64_t * );
*pi64 = mdate();
*pi64 = vlc_tick_now();
return VLC_SUCCESS;
case DEMUX_SET_NEXT_DEMUX_TIME:
......@@ -320,7 +320,7 @@ static block_t* GrabAudio( demux_t *p_demux )
/* Timestamp */
p_block->i_pts = p_block->i_dts =
mdate() - CLOCK_FREQ * (vlc_tick_t)i_correct /
vlc_tick_now() - CLOCK_FREQ * (vlc_tick_t)i_correct /
2 / ( p_sys->b_stereo ? 2 : 1) / p_sys->i_sample_rate;
return p_block;
......
......@@ -161,7 +161,7 @@ static void stream_read_cb(pa_stream *s, size_t length, void *userdata)
return;
}
vlc_tick_t pts = mdate();
vlc_tick_t pts = vlc_tick_now();
pa_usec_t latency;
int negative;
......
......@@ -309,7 +309,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
case DEMUX_GET_TIME:
pi64 = va_arg( args, int64_t * );
*pi64 = mdate() - p_sys->i_starttime;
*pi64 = vlc_tick_now() - p_sys->i_starttime;
return VLC_SUCCESS;
case DEMUX_GET_LENGTH:
......@@ -339,8 +339,8 @@ static void *DemuxThread( void *p_data )
{
demux_t *p_demux = (demux_t *) p_data;
demux_sys_t *p_sys = p_demux->p_sys;
p_sys->i_starttime = mdate();
vlc_tick_t i_next_frame_date = mdate() + p_sys->i_frame_interval;
p_sys->i_starttime = vlc_tick_now();
vlc_tick_t i_next_frame_date = vlc_tick_now() + p_sys->i_frame_interval;
int i_ret;
for(;;)
......@@ -408,7 +408,7 @@ static void *DemuxThread( void *p_data )
block_t *p_block = block_Duplicate( p_sys->p_block );
if (likely( p_block && p_sys->p_block ))
{
p_sys->p_block->i_dts = p_sys->p_block->i_pts = mdate() - p_sys->i_starttime;
p_sys->p_block->i_dts = p_sys->p_block->i_pts = vlc_tick_now() - p_sys->i_starttime;
es_out_SetPCR( p_demux->out, p_sys->p_block->i_pts );
es_out_Send( p_demux->out, p_sys->es, p_sys->p_block );
p_sys->p_block = p_block;
......
......@@ -90,7 +90,7 @@ static int rtp_timeout (vlc_tick_t deadline)
if (deadline == VLC_TS_INVALID)
return -1; /* infinite */
vlc_tick_t t = mdate ();
vlc_tick_t t = vlc_tick_now ();
if (t >= deadline)
return 0;
......
......@@ -256,7 +256,7 @@ rtp_queue (demux_t *demux, rtp_session_t *session, block_t *block)
block->i_buffer -= padding;
}
vlc_tick_t now = mdate ();
vlc_tick_t now = vlc_tick_now ();
rtp_source_t *src = NULL;
const uint16_t seq = rtp_seq (block);
const uint32_t ssrc = GetDWBE (block->p_buffer + 8);
......@@ -393,7 +393,7 @@ static void rtp_decode (demux_t *, const rtp_session_t *, rtp_source_t *);
bool rtp_dequeue (demux_t *demux, const rtp_session_t *session,
vlc_tick_t *restrict deadlinep)
{
vlc_tick_t now = mdate ();
vlc_tick_t now = vlc_tick_now ();
bool pending = false;
*deadlinep = INT64_MAX;
......
......@@ -425,9 +425,9 @@ static void *satip_thread(void *data) {
stream_t *access = data;
access_sys_t *sys = access->p_sys;
int sock = sys->udp_sock;
vlc_tick_t last_recv = mdate();
vlc_tick_t last_recv = vlc_tick_now();
ssize_t len;
vlc_tick_t next_keepalive = mdate() + sys->keepalive_interval * 1000 * 1000;
vlc_tick_t next_keepalive = vlc_tick_now() + sys->keepalive_interval * 1000 * 1000;
#ifdef HAVE_RECVMMSG
struct mmsghdr msgs[VLEN];
struct iovec iovecs[VLEN];
......@@ -449,7 +449,7 @@ static void *satip_thread(void *data) {
ufd.events = POLLIN;
#endif
while (last_recv > mdate() - RECV_TIMEOUT) {
while (last_recv > vlc_tick_now() - RECV_TIMEOUT) {
#ifdef HAVE_RECVMMSG
for (size_t i = 0; i < VLEN; i++) {
if (input_blocks[i] != NULL)
......@@ -468,7 +468,7 @@ static void *satip_thread(void *data) {
if (retval == -1)
continue;
last_recv = mdate();
last_recv = vlc_tick_now();
for (int i = 0; i < retval; ++i) {
block_t *block = input_blocks[i];
......@@ -504,13 +504,13 @@ static void *satip_thread(void *data) {
block_Release(block);
continue;
}
last_recv = mdate();
last_recv = vlc_tick_now();
block->p_buffer += RTP_HEADER_SIZE;
block->i_buffer = len - RTP_HEADER_SIZE;
block_FifoPut(sys->fifo, block);
#endif
if (sys->keepalive_interval > 0 && mdate() > next_keepalive) {
if (sys->keepalive_interval > 0 && vlc_tick_now() > next_keepalive) {
net_Printf(access, sys->tcp_sock,
"OPTIONS %s RTSP/1.0\r\n"
"CSeq: %d\r\n"
......@@ -519,7 +519,7 @@ static void *satip_thread(void *data) {
if (rtsp_handle(access, NULL) != RTSP_RESULT_OK)
msg_Warn(access, "Failed to keepalive RTSP session");
next_keepalive = mdate() + sys->keepalive_interval * 1000 * 1000;
next_keepalive = vlc_tick_now() + sys->keepalive_interval * 1000 * 1000;
}
}
......
......@@ -246,7 +246,7 @@ static int Open( vlc_object_t *p_this )
p_sys->es = es_out_Add( p_demux->out, &p_sys->fmt );
p_sys->i_start = mdate();
p_sys->i_start = vlc_tick_now();
return VLC_SUCCESS;
}
......@@ -275,10 +275,10 @@ static int Demux( demux_t *p_demux )
demux_sys_t *p_sys = p_demux->p_sys;
block_t *p_block;
if( !p_sys->i_next_date ) p_sys->i_next_date = mdate();
if( !p_sys->i_next_date ) p_sys->i_next_date = vlc_tick_now();
/* Frame skipping if necessary */
while( mdate() >= p_sys->i_next_date + p_sys->i_incr )
while( vlc_tick_now() >= p_sys->i_next_date + p_sys->i_incr )
p_sys->i_next_date += p_sys->i_incr;
vlc_tick_wait( p_sys->i_next_date );
......@@ -327,7 +327,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
case DEMUX_GET_TIME:
pi64 = va_arg( args, int64_t * );
*pi64 = mdate() - p_sys->i_start;
*pi64 = vlc_tick_now() - p_sys->i_start;
return VLC_SUCCESS;
/* TODO implement others */
......
......@@ -253,7 +253,7 @@ static void *Thread(void *data)
{
block_t *block = Shoot(demux);
block->i_pts = block->i_dts = mdate();
block->i_pts = block->i_dts = vlc_tick_now();
es_out_SetPCR(demux->out, block->i_pts);
es_out_Send(demux->out, sys->es, block);
}
......@@ -289,7 +289,7 @@ static int Control(demux_t *demux, int query, va_list args)
break;
case DEMUX_GET_TIME:
*va_arg(args, int64_t *) = mdate() - sys->start;
*va_arg(args, int64_t *) = vlc_tick_now() - sys->start;
break;
case DEMUX_GET_FPS:
......@@ -416,7 +416,7 @@ static int Open(vlc_object_t *obj)
goto error;
/* Initializes demux */
sys->start = mdate();
sys->start = vlc_tick_now();
if (vlc_clone(&sys->thread, Thread, demux, VLC_THREAD_PRIORITY_INPUT))
goto error;
......
......@@ -502,7 +502,7 @@ noshm:
/* Send block - zero copy */
if (sys->es != NULL)
{
block->i_pts = block->i_dts = mdate ();
block->i_pts = block->i_dts = vlc_tick_now ();
es_out_SetPCR(demux->out, block->i_pts);
es_out_Send (demux->out, sys->es, block);
......
......@@ -328,7 +328,7 @@ static void DemuxFile (void *data)
block_t *block = block_File(sys->fd, true);
if (block == NULL)
return;