Commit d1d3dc1d authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Remove I64C as well

parent 1379ab26
......@@ -862,9 +862,6 @@ VLC_EXPORT( char *, vlc_strcasestr, ( const char *s1, const char *s2 ) );
# define telldir vlc_telldir
#endif
/* 64 bits integer constant suffix */
#define I64C(x) INT64_C(x)
#if defined(WIN32) || defined(UNDER_CE)
/* win32, cl and icl support */
# if defined( _MSC_VER ) || !defined( __MINGW32__ )
......
......@@ -547,7 +547,7 @@ static void GetCDDBInfo( access_t *p_access, int i_titles, int *p_sectors )
cddb_disc_add_track( p_access->p_sys->p_disc, t );
i_size = ( p_sectors[i+1] - p_sectors[i] ) *
(int64_t)CDDA_DATA_SIZE;
i_length += I64C(1000000) * i_size / 44100 / 4 ;
i_length += INT64_C(1000000) * i_size / 44100 / 4 ;
}
cddb_disc_set_length( p_access->p_sys->p_disc, (int)(i_length/1000000) );
......
......@@ -907,7 +907,7 @@ CDDAFixupPlaylist( access_t *p_access, cdda_data_t *p_cdda,
asprintf( &t->psz_name, _("Track %i"), i_track );
t->i_size = i_track_frames * (int64_t) CDIO_CD_FRAMESIZE_RAW;
t->i_length = I64C(1000000) * t->i_size / CDDA_FREQUENCY_SAMPLE / 4;
t->i_length = INT64_C(1000000) * t->i_size / CDDA_FREQUENCY_SAMPLE / 4;
if( p_item )
{
......@@ -939,7 +939,7 @@ CDDAFixupPlaylist( access_t *p_access, cdda_data_t *p_cdda,
asprintf( &t->psz_name, _("Track %i"), i_track );
t->i_size = i_track_frames * (int64_t) CDIO_CD_FRAMESIZE_RAW;
t->i_length = I64C(1000000) * t->i_size
t->i_length = INT64_C(1000000) * t->i_size
/ CDDA_FREQUENCY_SAMPLE / 4;
if ( ! p_cdda->b_nav_mode ) {
......
......@@ -750,7 +750,7 @@ static block_t *GrabAudio( demux_t *p_demux )
i_correct += buf_info.bytes;
p_block->i_pts = p_block->i_dts =
mdate() - I64C(1000000) * (mtime_t)i_correct /
mdate() - INT64_C(1000000) * (mtime_t)i_correct /
2 / p_sys->channels / p_sys->i_sample_rate;
return p_block;
}
......
......@@ -255,7 +255,7 @@ static int HttpCallback( httpd_file_sys_t *p_args,
vlc_mutex_lock( &p_sys->httpd_mutex );
p_sys->i_httpd_timeout = mdate() + I64C(3000000); /* 3 s */
p_sys->i_httpd_timeout = mdate() + INT64_C(3000000); /* 3 s */
p_sys->psz_request = psz_request;
p_sys->b_request_frontend_info = true;
if ( p_sys->i_ca_handle )
......
......@@ -353,7 +353,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_GET_PTS_DELAY:
pi_64 = (int64_t*)va_arg( args, int64_t * );
*pi_64 = var_GetInteger( p_access, "file-caching" ) * I64C(1000);
*pi_64 = var_GetInteger( p_access, "file-caching" ) * INT64_C(1000);
break;
/* */
......
......@@ -549,7 +549,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_GET_PTS_DELAY:
pi_64 = (int64_t*)va_arg( args, int64_t * );
var_Get( p_access, "ftp-caching", &val );
*pi_64 = (int64_t)var_GetInteger( p_access, "ftp-caching" ) * I64C(1000);
*pi_64 = (int64_t)var_GetInteger( p_access, "ftp-caching" ) * INT64_C(1000);
break;
/* */
......
......@@ -403,7 +403,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_GET_PTS_DELAY:
pi_64 = (int64_t*)va_arg( args, int64_t * );
*pi_64 = var_GetInteger( p_access,
"gnomevfs-caching" ) * I64C(1000);
"gnomevfs-caching" ) * INT64_C(1000);
break;
/* */
......
......@@ -271,7 +271,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_GET_PTS_DELAY:
pi_64 = (int64_t*)va_arg( args, int64_t * );
*pi_64 = (int64_t)var_GetInteger( p_access, "mms-caching" ) * I64C(1000);
*pi_64 = (int64_t)var_GetInteger( p_access, "mms-caching" ) * INT64_C(1000);
break;
case ACCESS_GET_PRIVATE_ID_STATE:
......
......@@ -260,7 +260,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_GET_PTS_DELAY:
pi_64 = (int64_t*)va_arg( args, int64_t * );
var_Get( p_access, "mms-caching", &val );
*pi_64 = (int64_t)var_GetInteger( p_access, "mms-caching" ) * I64C(1000);
*pi_64 = (int64_t)var_GetInteger( p_access, "mms-caching" ) * INT64_C(1000);
break;
case ACCESS_GET_PRIVATE_ID_STATE:
......
......@@ -467,7 +467,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_GET_PTS_DELAY:
pi_64 = (int64_t*)va_arg( args, int64_t * );
*pi_64 = var_GetInteger( p_access, "rtmp-caching" ) * I64C(1000);
*pi_64 = var_GetInteger( p_access, "rtmp-caching" ) * INT64_C(1000);
break;
/* */
......
......@@ -188,7 +188,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_GET_PTS_DELAY:
pi_64 = (int64_t*)va_arg( args, int64_t * );
*pi_64 = (int64_t)var_GetInteger( p_access, "tcp-caching" ) * I64C(1000);
*pi_64 = (int64_t)var_GetInteger( p_access, "tcp-caching" ) * INT64_C(1000);
break;
/* */
......
......@@ -1415,7 +1415,7 @@ static block_t *GrabAudio( demux_t *p_demux )
}
p_block->i_pts = p_block->i_dts =
mdate() - I64C(1000000) * (mtime_t)i_correct /
mdate() - INT64_C(1000000) * (mtime_t)i_correct /
2 / ( p_sys->b_stereo ? 2 : 1) / p_sys->i_sample_rate;
return p_block;
......
......@@ -1646,7 +1646,7 @@ static block_t* GrabAudio( demux_t *p_demux )
/* Timestamp */
p_block->i_pts = p_block->i_dts =
mdate() - I64C(1000000) * (mtime_t)i_correct /
mdate() - INT64_C(1000000) * (mtime_t)i_correct /
2 / ( p_sys->b_stereo ? 2 : 1) / p_sys->i_sample_rate;
return p_block;
......
......@@ -1043,7 +1043,7 @@ static void DirectSoundThread( notification_thread_t *p_notif )
/* Detect underruns */
if( l_queued && mtime - last_time >
I64C(1000000) * l_queued / p_aout->output.output.i_rate )
INT64_C(1000000) * l_queued / p_aout->output.output.i_rate )
{
msg_Dbg( p_aout, "detected underrun!" );
}
......@@ -1058,7 +1058,7 @@ static void DirectSoundThread( notification_thread_t *p_notif )
for( i = 0; i < l_free_slots; i++ )
{
aout_buffer_t *p_buffer = aout_OutputNextBuffer( p_aout,
mtime + I64C(1000000) * (i * FRAME_SIZE + l_queued) /
mtime + INT64_C(1000000) * (i * FRAME_SIZE + l_queued) /
p_aout->output.output.i_rate, b_sleek );
/* If there is no audio data available and we have some buffered
......@@ -1071,7 +1071,7 @@ static void DirectSoundThread( notification_thread_t *p_notif )
/* Sleep a reasonable amount of time */
l_queued += (i * FRAME_SIZE);
msleep( I64C(1000000) * l_queued / p_aout->output.output.i_rate / 2 );
msleep( INT64_C(1000000) * l_queued / p_aout->output.output.i_rate / 2 );
}
/* make sure the buffer isn't playing */
......
......@@ -1058,7 +1058,7 @@ static int EncoderSetVideoType( encoder_t *p_enc, IMediaObject *p_dmo )
vih.rcSource.bottom = p_enc->fmt_in.video.i_height;
vih.rcTarget = vih.rcSource;
vih.AvgTimePerFrame = I64C(10000000) / 25; //FIXME
vih.AvgTimePerFrame = INT64_C(10000000) / 25; //FIXME
dmo_type.majortype = MEDIATYPE_Video;
//dmo_type.subtype = MEDIASUBTYPE_RGB24;
......
......@@ -908,7 +908,7 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
memcpy( p_block->p_buffer, p_sys->p_buffer_out, i_out );
/* FIXME, 3-2 pulldown is not handled correctly */
p_block->i_length = I64C(1000000) *
p_block->i_length = INT64_C(1000000) *
p_enc->fmt_in.video.i_frame_rate_base /
p_enc->fmt_in.video.i_frame_rate;
......
......@@ -363,14 +363,14 @@ static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input )
if( p_data->i_pts > 0 )
pkt.pts = p_data->i_pts * p_stream->time_base.den /
I64C(1000000) / p_stream->time_base.num;
INT64_C(1000000) / p_stream->time_base.num;
if( p_data->i_dts > 0 )
pkt.dts = p_data->i_dts * p_stream->time_base.den /
I64C(1000000) / p_stream->time_base.num;
INT64_C(1000000) / p_stream->time_base.num;
/* this is another hack to prevent libavformat from triggering the "non monotone timestamps" check in avformat/utils.c */
p_stream->cur_dts = ( p_data->i_dts * p_stream->time_base.den /
I64C(1000000) / p_stream->time_base.num ) - 1;
INT64_C(1000000) / p_stream->time_base.num ) - 1;
if( av_write_frame( p_sys->oc, &pkt ) < 0 )
{
......
......@@ -464,7 +464,7 @@ picture_t *E_(DecodeVideo)( decoder_t *p_dec, block_t **pp_block )
}
if( !p_dec->b_pace_control && (p_sys->i_late_frames > 0) &&
(mdate() - p_sys->i_late_frames_start > I64C(5000000)) )
(mdate() - p_sys->i_late_frames_start > INT64_C(5000000)) )
{
if( p_sys->i_pts )
{
......@@ -676,7 +676,7 @@ picture_t *E_(DecodeVideo)( decoder_t *p_dec, block_t **pp_block )
if( p_dec->fmt_in.video.i_frame_rate > 0 &&
p_dec->fmt_in.video.i_frame_rate_base > 0 )
{
p_sys->i_pts += I64C(1000000) *
p_sys->i_pts += INT64_C(1000000) *
(2 + p_sys->p_ff_pic->repeat_pict) *
p_dec->fmt_in.video.i_frame_rate_base *
p_block->i_rate / INPUT_RATE_DEFAULT /
......@@ -684,7 +684,7 @@ picture_t *E_(DecodeVideo)( decoder_t *p_dec, block_t **pp_block )
}
else if( p_sys->p_context->time_base.den > 0 )
{
p_sys->i_pts += I64C(1000000) *
p_sys->i_pts += INT64_C(1000000) *
(2 + p_sys->p_ff_pic->repeat_pict) *
p_sys->p_context->time_base.num *
p_block->i_rate / INPUT_RATE_DEFAULT /
......
......@@ -1015,12 +1015,12 @@ static int SyncInfo( decoder_t *p_dec, uint8_t *p_buf,
if( i_blocksize_hint && b_variable_blocksize )
{
i_sample_number = read_utf8( &p_buf[i_header++], &i_read );
if( i_sample_number == I64C(0xffffffffffffffff) ) return 0;
if( i_sample_number == INT64_C(0xffffffffffffffff) ) return 0;
}
else
{
i_sample_number = read_utf8( &p_buf[i_header++], &i_read );
if( i_sample_number == I64C(0xffffffffffffffff) ) return 0;
if( i_sample_number == INT64_C(0xffffffffffffffff) ) return 0;
if( p_sys->b_stream_info )
i_sample_number *= p_sys->stream_info.min_blocksize;
......@@ -1105,14 +1105,14 @@ static uint64_t read_utf8( const uint8_t *p_buf, int *pi_read )
i = 6;
}
else {
return I64C(0xffffffffffffffff);
return INT64_C(0xffffffffffffffff);
}
for( j = 1; j <= i; j++ )
{
if( !(p_buf[j] & 0x80) || (p_buf[j] & 0x40) ) /* 10xxxxxx */
{
return I64C(0xffffffffffffffff);
return INT64_C(0xffffffffffffffff);
}
i_result <<= 6;
i_result |= (p_buf[j] & 0x3F);
......
......@@ -248,7 +248,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
}
/* Date management: 1 frame per packet */
p_sys->i_pts += ( I64C(1000000) * 1.0 / 25 /*FIXME*/ );
p_sys->i_pts += ( INT64_C(1000000) * 1.0 / 25 /*FIXME*/ );
*pp_block = NULL;
return p_buf;
......
......@@ -443,7 +443,7 @@ static void *ProcessPacket( decoder_t *p_dec, ogg_packet *p_oggpacket,
}
/* Date management */
p_sys->i_pts += ( I64C(1000000) * p_sys->ti.fps_denominator /
p_sys->i_pts += ( INT64_C(1000000) * p_sys->ti.fps_denominator /
p_sys->ti.fps_numerator ); /* 1 frame per packet */
return p_buf;
......
......@@ -1337,7 +1337,7 @@ static block_t *Encode( encoder_t *p_enc, picture_t *p_pict )
p_block->i_flags |= BLOCK_FLAG_TYPE_B;
/* This isn't really valid for streams with B-frames */
p_block->i_length = I64C(1000000) *
p_block->i_length = INT64_C(1000000) *
p_enc->fmt_in.video.i_frame_rate_base /
p_enc->fmt_in.video.i_frame_rate;
......
......@@ -442,9 +442,9 @@ static void ParseExecute( httpd_file_sys_t *p_args, char *p_buffer,
var_Get( p_sys->p_input, "position", &val);
sprintf( position, "%d" , (int)((val.f_float) * 100.0));
var_Get( p_sys->p_input, "time", &val);
sprintf( time, "%"PRIi64, (int64_t)val.i_time / I64C(1000000) );
sprintf( time, "%"PRIi64, (int64_t)val.i_time / INT64_C(1000000) );
var_Get( p_sys->p_input, "length", &val);
sprintf( length, "%"PRIi64, (int64_t)val.i_time / I64C(1000000) );
sprintf( length, "%"PRIi64, (int64_t)val.i_time / INT64_C(1000000) );
var_Get( p_sys->p_input, "state", &val );
if( val.i_int == PLAYING_S )
......
......@@ -227,7 +227,7 @@ static int Demux( demux_t *p_demux )
if( p_block_out->i_length )
{
p_sys->i_mux_rate =
p_block_out->i_buffer * I64C(1000000)/p_block_out->i_length;
p_block_out->i_buffer * INT64_C(1000000)/p_block_out->i_length;
}
/* set PCR */
......
......@@ -208,7 +208,7 @@ static int Demux( demux_t *p_demux )
if( p_block_out->i_length )
{
p_sys->i_mux_rate =
p_block_out->i_buffer * I64C(1000000) / p_block_out->i_length;
p_block_out->i_buffer * INT64_C(1000000) / p_block_out->i_length;
}
/* set PCR */
......
......@@ -316,7 +316,7 @@ static int ControlSetTime( demux_t *p_demux, int64_t i_time )
(p_sys->seekpoint[i+1]->i_time_offset-p_sys->seekpoint[i]->i_time_offset);
/* XXX We do exact seek if it's not too far away(45s) */
if( i_delta_time < 45*I64C(1000000) )
if( i_delta_time < 45*INT64_C(1000000) )
{
if( stream_Seek( p_demux->s, p_sys->seekpoint[i]->i_byte_offset+p_sys->i_data_pos ) )
return VLC_EGENERIC;
......@@ -462,7 +462,7 @@ static int ReadMeta( demux_t *p_demux, uint8_t **pp_streaminfo, int *pi_streami
/* */
ParseStreamInfo( p_demux, &i_sample_rate, &i_sample_count, *pp_streaminfo, *pi_streaminfo );
if( i_sample_rate > 0 )
p_sys->i_length = i_sample_count * I64C(1000000)/i_sample_rate;
p_sys->i_length = i_sample_count * INT64_C(1000000)/i_sample_rate;
/* Be sure we have seekpoint 0 */
s = vlc_seekpoint_New();
......@@ -516,7 +516,7 @@ static void ParseStreamInfo( demux_t *p_demux, int *pi_rate, int64_t *pi_count,
const int i_skip = 4+4;
*pi_rate = GetDWBE(&p_data[i_skip+4+6]) >> 12;
*pi_count = GetQWBE(&p_data[i_skip+4+6]) & ((I64C(1)<<36)-1);
*pi_count = GetQWBE(&p_data[i_skip+4+6]) & ((INT64_C(1)<<36)-1);
}
static void ParseSeekTable( demux_t *p_demux, const uint8_t *p_data, int i_data,
......@@ -539,7 +539,7 @@ static void ParseSeekTable( demux_t *p_demux, const uint8_t *p_data, int i_data,
continue;
s = vlc_seekpoint_New();
s->i_time_offset = i_sample * I64C(1000000)/i_sample_rate;
s->i_time_offset = i_sample * INT64_C(1000000)/i_sample_rate;
s->i_byte_offset = GetQWBE( &p_data[4+18*i+8] );
/* Check for duplicate entry */
......
......@@ -1382,7 +1382,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
case DEMUX_SET_PAUSE_STATE:
{
double d_npt = (double) p_sys->i_npt / I64C(1000000);
double d_npt = (double) p_sys->i_npt / INT64_C(1000000);
int i;
b_bool = (bool)va_arg( args, int );
......
......@@ -4868,14 +4868,14 @@ void matroska_segment_c::ParseChapterAtom( int i_level, KaxChapterAtom *ca, chap
else if( MKV_IS_ID( l, KaxChapterTimeStart ) )
{
KaxChapterTimeStart &start =*(KaxChapterTimeStart*)l;
chapters.i_start_time = uint64( start ) / I64C(1000);
chapters.i_start_time = uint64( start ) / INT64_C(1000);
msg_Dbg( &sys.demuxer, "| | | | + ChapterTimeStart: %lld", chapters.i_start_time );
}
else if( MKV_IS_ID( l, KaxChapterTimeEnd ) )
{
KaxChapterTimeEnd &end =*(KaxChapterTimeEnd*)l;
chapters.i_end_time = uint64( end ) / I64C(1000);
chapters.i_end_time = uint64( end ) / INT64_C(1000);
msg_Dbg( &sys.demuxer, "| | | | + ChapterTimeEnd: %lld", chapters.i_end_time );
}
......@@ -5080,7 +5080,7 @@ void matroska_segment_c::ParseChapters( KaxChapters *chapters )
if ( stored_editions.size() != 0 && stored_editions[i_default_edition]->b_ordered )
{
/* update the duration of the segment according to the sum of all sub chapters */
i_dur = stored_editions[i_default_edition]->Duration() / I64C(1000);
i_dur = stored_editions[i_default_edition]->Duration() / INT64_C(1000);
if (i_dur > 0)
i_duration = i_dur;
}
......
......@@ -154,7 +154,7 @@ static void MP4_ConvertDate2Str( char *psz, uint64_t i_date )
int i_sec;
/* date begin at 1 jan 1904 */
i_date += ((I64C(1904) * 365) + 17) * 24 * 60 * 60;
i_date += ((INT64_C(1904) * 365) + 17) * 24 * 60 * 60;
i_day = i_date / ( 60*60*24);
i_hour = ( i_date /( 60*60 ) ) % 60;
......
......@@ -229,7 +229,7 @@ static inline int64_t MP4_TrackGetDTS( demux_t *p_demux, mp4_track_t *p_track )
if( i_dts < 0 ) i_dts = 0;
}
return I64C(1000000) * i_dts / p_track->i_timescale;
return INT64_C(1000000) * i_dts / p_track->i_timescale;
}
static inline int64_t MP4_TrackGetPTSDelta( demux_t *p_demux, mp4_track_t *p_track )
......@@ -244,7 +244,7 @@ static inline int64_t MP4_TrackGetPTSDelta( demux_t *p_demux, mp4_track_t *p_tra
for( i_index = 0;; i_index++ )
{
if( i_sample < ck->p_sample_count_pts[i_index] )
return ck->p_sample_offset_pts[i_index] * I64C(1000000) /
return ck->p_sample_offset_pts[i_index] * INT64_C(1000000) /
(int64_t)p_track->i_timescale;
i_sample -= ck->p_sample_count_pts[i_index];
......@@ -253,7 +253,7 @@ static inline int64_t MP4_TrackGetPTSDelta( demux_t *p_demux, mp4_track_t *p_tra
static inline int64_t MP4_GetMoviePTS(demux_sys_t *p_sys )
{
return I64C(1000000) * p_sys->i_time / p_sys->i_timescale;
return INT64_C(1000000) * p_sys->i_time / p_sys->i_timescale;
}
/* Function to lookup the currently playing item */
......@@ -1754,7 +1754,7 @@ static int TrackTimeToSampleChunk( demux_t *p_demux, mp4_track_t *p_track,
/* now calculate i_start for this elst */
/* offset */
i_start -= p_track->i_elst_time * I64C(1000000) / p_sys->i_timescale;
i_start -= p_track->i_elst_time * INT64_C(1000000) / p_sys->i_timescale;
if( i_start < 0 )
{
*pi_chunk = 0;
......@@ -2052,7 +2052,7 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track,
elst->i_segment_duration[i] * 1000 / p_sys->i_timescale,
elst->i_media_time[i] >= 0 ?
(int64_t)(elst->i_media_time[i] * 1000 / p_track->i_timescale) :
I64C(-1),
INT64_C(-1),
elst->i_media_rate_integer[i],
elst->i_media_rate_fraction[i] );
}
......
......@@ -226,7 +226,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 =
1 + I64C(1000000) * p_sys->i_position / p_sys->info.sample_freq;
1 + INT64_C(1000000) * p_sys->i_position / p_sys->info.sample_freq;
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_data->i_dts );
......@@ -257,7 +257,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
case DEMUX_GET_LENGTH:
pi64 = (int64_t*)va_arg( args, int64_t * );
*pi64 = I64C(1000000) * p_sys->info.pcm_samples /
*pi64 = INT64_C(1000000) * p_sys->info.pcm_samples /
p_sys->info.sample_freq;
return VLC_SUCCESS;
......@@ -272,7 +272,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
case DEMUX_GET_TIME:
pi64 = (int64_t*)va_arg( args, int64_t * );
*pi64 = I64C(1000000) * p_sys->i_position /
*pi64 = INT64_C(1000000) * p_sys->i_position /
p_sys->info.sample_freq;
return VLC_SUCCESS;
......
......@@ -164,9 +164,9 @@ static int Demux( demux_t *p_demux)
p_block_out->p_next = NULL;
p_sys->i_pts = p_block_out->i_pts;
if( p_sys->i_pts > M4A_PTS_START + I64C(500000) )
if( p_sys->i_pts > M4A_PTS_START + INT64_C(500000) )
p_sys->i_bitrate_avg =
8*I64C(1000000)*p_sys->i_bytes/(p_sys->i_pts-M4A_PTS_START);
8*INT64_C(1000000)*p_sys->i_bytes/(p_sys->i_pts-M4A_PTS_START);
p_sys->i_bytes += p_block_out->i_buffer;
es_out_Send( p_demux->out, p_sys->p_es, p_block_out );
......@@ -207,7 +207,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
if( (i_query == DEMUX_SET_POSITION || i_query == DEMUX_SET_TIME ) &&
i_ret == VLC_SUCCESS && p_sys->i_bitrate_avg > 0 )
{
int64_t i_time = I64C(8000000) * stream_Tell(p_demux->s) /
int64_t i_time = INT64_C(8000000) * stream_Tell(p_demux->s) /
p_sys->i_bitrate_avg;
if( i_time >= 0 )
......
......@@ -244,7 +244,7 @@ static int Open( vlc_object_t * p_this )
if( p_sys->i_xing_bytes && p_sys->i_xing_frames &&
p_sys->i_xing_frame_samples )
{
p_sys->i_bitrate_avg = p_sys->i_xing_bytes * I64C(8) *
p_sys->i_bitrate_avg = p_sys->i_xing_bytes * INT64_C(8) *
p_sys->p_packetizer->fmt_out.audio.i_rate /
p_sys->i_xing_frames / p_sys->i_xing_frame_samples;
}
......@@ -389,7 +389,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
if( !i_ret && p_sys->i_bitrate_avg > 0 &&
(i_query == DEMUX_SET_POSITION || i_query == DEMUX_SET_TIME) )
{
int64_t i_time = I64C(8000000) * stream_Tell(p_demux->s) /
int64_t i_time = INT64_C(8000000) * stream_Tell(p_demux->s) /
p_sys->i_bitrate_avg;
/* Fix time_offset */
......
......@@ -445,7 +445,7 @@ static void Ogg_UpdatePCR( logical_stream_t *p_stream,
{
if( p_stream->fmt.i_codec != VLC_FOURCC( 't','h','e','o' ) )
{
p_stream->i_pcr = p_oggpacket->granulepos * I64C(1000000)
p_stream->i_pcr = p_oggpacket->granulepos * INT64_C(1000000)
/ p_stream->f_rate;
}
else
......@@ -455,7 +455,7 @@ static void Ogg_UpdatePCR( logical_stream_t *p_stream,
ogg_int64_t pframe = p_oggpacket->granulepos -
( iframe << p_stream->i_theora_keyframe_granule_shift );
p_stream->i_pcr = ( iframe + pframe ) * I64C(1000000)
p_stream->i_pcr = ( iframe + pframe ) * INT64_C(1000000)
/ p_stream->f_rate;
}
......@@ -469,10 +469,10 @@ static void Ogg_UpdatePCR( logical_stream_t *p_stream,
* If we can't then don't touch the old value. */
if( p_stream->fmt.i_cat == VIDEO_ES )
/* 1 frame per packet */
p_stream->i_interpolated_pcr += (I64C(1000000) / p_stream->f_rate);
p_stream->i_interpolated_pcr += (INT64_C(1000000) / p_stream->f_rate);
else if( p_stream->fmt.i_bitrate )
p_stream->i_interpolated_pcr +=
( p_oggpacket->bytes * I64C(1000000) /
( p_oggpacket->bytes * INT64_C(1000000) /
p_stream->fmt.i_bitrate / 8 );
}
}
......
......@@ -143,7 +143,7 @@ static int Demux( demux_t *p_demux )
psz_parse += sizeof("EXTINF:") - 1;
parseEXTINF( psz_parse, &psz_artist, &psz_name, &i_parsed_duration );
if( i_parsed_duration >= 0 )
i_duration = i_parsed_duration * I64C(1000000);
i_duration = i_parsed_duration * INT64_C(1000000);
if( psz_name )
psz_name = strdup( psz_name );
if( psz_artist )
......
......@@ -327,7 +327,7 @@ static int Demux( demux_t *p_demux )
if( !p_sys->b_hurry_up )
{
p_sys->i_pcr += ( I64C(1000000) / p_sys->f_rate );
p_sys->i_pcr += ( INT64_C(1000000) / p_sys->f_rate );
}
return 1;
......
......@@ -380,7 +380,7 @@ static int Demux( demux_t *p_demux )
p_block->i_dts = p_block->i_pts = p_sys->i_pcr;
es_out_Send( p_demux->out, p_sys->p_es_video, p_block );
p_sys->i_pcr += ( I64C(1000000) / p_sys->f_fps );
p_sys->i_pcr += ( INT64_C(1000000) / p_sys->f_fps );
return 1;
}
......
......@@ -1190,9 +1190,9 @@ static int DVBEventInformation( demux_t *p_demux, int64_t *pi_time, int64_t *pi_
if( p_sys->i_dvb_start <= t && t < p_sys->i_dvb_start + p_sys->i_dvb_length )
{
if( pi_length )
*pi_length = p_sys->i_dvb_length * I64C(1000000);
*pi_length = p_sys->i_dvb_length * INT64_C(1000000);
if( pi_time )
*pi_time = (t - p_sys->i_dvb_start) * I64C(1000000);
*pi_time = (t - p_sys->i_dvb_start) * INT64_C(1000000);
return VLC_SUCCESS;
}
}
......@@ -1255,7 +1255,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
pi64 = (int64_t*)va_arg( args, int64_t * );
if( p_sys->i_mux_rate > 0 )
{
*pi64 = I64C(1000000) * ( stream_Size( p_demux->s ) / 50 ) /
*pi64 = INT64_C(1000000) * ( stream_Size( p_demux->s ) / 50 ) /
p_sys->i_mux_rate;
return VLC_SUCCESS;
}
......
......@@ -194,7 +194,7 @@ static int Demux( demux_t *p_demux )
p_data = 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 = (int64_t)(1 + I64C(1000000) * p_sys->i_currentframe) * TTA_FRAMETIME;
p_data->i_dts = p_data->i_pts = (int64_t)(1 + INT64_C(1000000) * p_sys->i_currentframe) * TTA_FRAMETIME;
p_sys->i_currentframe++;
......@@ -248,12 +248,12 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
case DEMUX_GET_LENGTH:
pi64 = (int64_t*)va_arg( args, int64_t * );
*pi64 = I64C(1000000) * p_sys->i_totalframes * TTA_FRAMETIME;
*pi64 = INT64_C(1000000) * p_sys->i_totalframes * TTA_FRAMETIME;
return VLC_SUCCESS;
case DEMUX_GET_TIME:
pi64 = (int64_t*)va_arg( args, int64_t * );
*pi64 = I64C(1000000) * p_sys->i_currentframe * TTA_FRAMETIME;
*pi64 = INT64_C(1000000) * p_sys->i_currentframe * TTA_FRAMETIME;
return VLC_SUCCESS;
default:
......
......@@ -166,13 +166,13 @@ static int Demux( demux_t *p_demux)
if( p_sys->p_packetizer->fmt_out.video.i_frame_rate > 0 &&
p_sys->p_packetizer->fmt_out.video.i_frame_rate_base > 0 )
p_sys->i_dts += I64C(1000000) *
p_sys->i_dts += INT64_C(1000000) *
p_sys->p_packetizer->fmt_out.video.i_frame_rate_base /
p_sys->p_packetizer->fmt_out.video.i_frame_rate;
else if( p_sys->f_fps > 0.001 )
p_sys->i_dts += (int64_t)((double)1000000.0 / p_sys->f_fps);
else
p_sys->i_dts += I64C(1000000) / 25;
p_sys->i_dts += INT64_C(1000000) / 25;
}
}
return 1;
......
......@@ -564,7 +564,7 @@ void E_(GtkDisplayDate)( GtkAdjustment *p_adj, gpointer userdata )
char psz_time[ MSTRTIME_MAX_SIZE ];
int64_t i_seconds;
i_seconds = var_GetTime( p_intf->p_sys->p_input, "time" ) / I64C(1000000 );
i_seconds = var_GetTime( p_intf->p_sys->p_input, "time" ) / INT64_C(1000000 );
secstotimestr( psz_time, i_seconds );
gtk_label_set_text( GTK_LABEL( p_intf->p_sys->p_slider_label ),
......
......@@ -760,10 +760,10 @@ void Interface::OnSliderUpdate( int wp )
char psz_time[ MSTRTIME_MAX_SIZE ], psz_total[ MSTRTIME_MAX_SIZE ];
mtime_t i_seconds;
i_seconds = var_GetTime( p_input, "length" ) / I64C(1000000 );
i_seconds = var_GetTime( p_input, "length" ) / INT64_C(1000000 );
secstotimestr( psz_total, i_seconds );
i_seconds = var_GetTime( p_input, "time" ) / I64C(1000000 );
i_seconds = var_GetTime( p_input, "time" ) / INT64_C(1000000 );
secstotimestr( psz_time, i_seconds );
SendMessage( hwndLabel, WM_SETTEXT, (WPARAM)1,
......
......@@ -530,7 +530,7 @@ again:
block_t *p_next = block_FifoShow( p_input->p_fifo );
int64_t i_diff = p_next->i_dts - p_data->i_dts;
if( i_diff < I64C(1000000 ) ) /* protection */
if( i_diff < INT64_C(1000000 ) ) /* protection */
{
p_data->i_length = i_diff;
}
......@@ -740,14 +740,14 @@ static bo_t *GetESDS( mp4_stream_t *p_stream )
i_bitrate_avg += p_stream->entry[i].i_size;
if( p_stream->entry[i].i_length > 0)
{
int64_t i_bitrate = I64C(8000000) * p_stream->entry[i].i_size / p_stream->entry[i].i_length;
int64_t i_bitrate = INT64_C(8000000) * p_stream->entry[i].i_size / p_stream->entry[i].i_length;
if( i_bitrate > i_bitrate_max )
i_bitrate_max = i_bitrate;
}
}