Commit 5a70cb3c authored by Steve Lhomme's avatar Steve Lhomme Committed by Rémi Denis-Courmont

modules: use CLOCK_FREQ/2 instead of 500000 mtime_t

Signed-off-by: Rémi Denis-Courmont's avatarRémi Denis-Courmont <remi@remlab.net>
parent ba3c3038
......@@ -61,7 +61,7 @@
#define SDIAUDIO_SAMPLESIZE_FILE "/sys/class/sdiaudio/sdiaudiorx%u/sample_size"
#define SDIAUDIO_CHANNELS_FILE "/sys/class/sdiaudio/sdiaudiorx%u/channels"
#define NB_VBUFFERS 2
#define CLOCK_GAP INT64_C(500000)
#define CLOCK_GAP (CLOCK_FREQ/2)
#define START_DATE INT64_C(4294967296)
#define MAX_AUDIOS 4
......
......@@ -55,7 +55,7 @@
#define SDI_MODE_FILE "/sys/class/sdi/sdirx%u/mode"
#define READ_TIMEOUT 80000
#define RESYNC_TIMEOUT 500000
#define CLOCK_GAP INT64_C(500000)
#define CLOCK_GAP (CLOCK_FREQ/2)
#define START_DATE INT64_C(4294967296)
#define DEMUX_BUFFER_SIZE 1350000
......
......@@ -1518,7 +1518,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
pi64 = va_arg( args, int64_t * );
if( p_sys->f_npt > 0 )
{
*pi64 = (int64_t)(p_sys->f_npt * CLOCK_FREQ);
*pi64 = (int64_t)(p_sys->f_npt * (double)CLOCK_FREQ);
return VLC_SUCCESS;
}
return VLC_EGENERIC;
......@@ -1527,7 +1527,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
pi64 = va_arg( args, int64_t * );
if( p_sys->f_npt_length > 0 )
{
double d_length = p_sys->f_npt_length * CLOCK_FREQ;
double d_length = p_sys->f_npt_length * (double)CLOCK_FREQ;
if( d_length >= INT64_MAX )
*pi64 = INT64_MAX;
else
......
......@@ -155,7 +155,7 @@ static int Open( vlc_object_t *p_this )
return VLC_ENOMEM;
p_sys->f_fps = var_CreateGetFloat( p_demux, "screen-fps" );
p_sys->i_incr = CLOCK_FREQ / p_sys->f_fps;;
p_sys->i_incr = CLOCK_FREQ / p_sys->f_fps;
p_sys->i_next_date = 0;
#ifdef SCREEN_SUBSCREEN
......
......@@ -38,7 +38,7 @@
#define SMOOTHPOS_SAMPLE_COUNT 10
#define SMOOTHPOS_INTERVAL_US INT64_C(30000) // 30ms
#define AUDIOTIMESTAMP_INTERVAL_US INT64_C(500000) // 500ms
#define AUDIOTIMESTAMP_INTERVAL_US (CLOCK_FREQ/2) // 500ms
static int Open( vlc_object_t * );
static void Close( vlc_object_t * );
......
......@@ -842,7 +842,7 @@ AudioStreamChangeFormat(audio_output_t *p_aout, AudioStreamID i_stream_id,
* set. */
if (i > 0)
{
mtime_t timeout = mdate() + 500000;
mtime_t timeout = mdate() + CLOCK_FREQ/2;
if (vlc_cond_timedwait(&w.cond, &w.lock, timeout))
msg_Dbg(p_aout, "reached timeout");
}
......
......@@ -350,7 +350,7 @@ static int Demux( demux_t *p_demux )
es_out_SetPCR( p_demux->out, p_block_out->i_dts );
}
/* Re-estimate bitrate */
if( p_sys->b_estimate_bitrate && p_sys->i_pts > INT64_C(500000) )
if( p_sys->b_estimate_bitrate && p_sys->i_pts > (CLOCK_FREQ/2) )
p_sys->i_bitrate_avg = 8*1000000*p_sys->i_bytes/(p_sys->i_pts-1);
p_sys->i_bytes += p_block_out->i_buffer;
......
......@@ -166,11 +166,11 @@ static void *Run( void *data )
vlc_restorecancel(canc);
if( i_status == 2 )
{
msleep( 5000000 );
msleep( 5*CLOCK_FREQ );
i_status = 0;
}
else
msleep( 500000 );
msleep( CLOCK_FREQ/2 );
}
return NULL;
}
......
......@@ -492,7 +492,7 @@ int intf_sys_t::pace()
m_interrupted = false;
vlc_interrupt_register( interrupt_wake_up_cb, this );
int ret = 0;
mtime_t deadline = mdate() + INT64_C(500000);
mtime_t deadline = mdate() + CLOCK_FREQ/2;
/* Wait for the sout to send more data via http (m_pace), or wait for the
* CC to finish. In case the demux filter is EOF, we always wait for
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment