From d1d3dc1d109110bf68cb048c429f6f05a3839200 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Thu, 1 May 2008 22:11:47 +0300 Subject: [PATCH] Remove I64C as well --- include/vlc_common.h | 3 --- modules/access/cdda.c | 2 +- modules/access/cdda/info.c | 4 ++-- modules/access/dc1394.c | 2 +- modules/access/dvb/http.c | 2 +- modules/access/file.c | 2 +- modules/access/ftp.c | 2 +- modules/access/gnomevfs.c | 2 +- modules/access/mms/mmsh.c | 2 +- modules/access/mms/mmstu.c | 2 +- modules/access/rtmp/access.c | 2 +- modules/access/tcp.c | 2 +- modules/access/v4l.c | 2 +- modules/access/v4l2/v4l2.c | 2 +- modules/audio_output/directx.c | 6 ++--- modules/codec/dmo/dmo.c | 2 +- modules/codec/ffmpeg/encoder.c | 2 +- modules/codec/ffmpeg/mux.c | 6 ++--- modules/codec/ffmpeg/video.c | 6 ++--- modules/codec/flac.c | 8 +++---- modules/codec/rawvideo.c | 2 +- modules/codec/theora.c | 2 +- modules/codec/x264.c | 2 +- modules/control/http/http.c | 4 ++-- modules/demux/a52.c | 2 +- modules/demux/dts.c | 2 +- modules/demux/flac.c | 8 +++---- modules/demux/live555.cpp | 2 +- modules/demux/mkv.cpp | 6 ++--- modules/demux/mp4/libmp4.c | 2 +- modules/demux/mp4/mp4.c | 10 ++++----- modules/demux/mpc.c | 6 ++--- modules/demux/mpeg/m4a.c | 6 ++--- modules/demux/mpeg/mpga.c | 4 ++-- modules/demux/ogg.c | 8 +++---- modules/demux/playlist/m3u.c | 2 +- modules/demux/rawdv.c | 2 +- modules/demux/rawvid.c | 2 +- modules/demux/ts.c | 6 ++--- modules/demux/tta.c | 6 ++--- modules/demux/vc1.c | 4 ++-- modules/gui/pda/pda.c | 2 +- modules/gui/wince/interface.cpp | 4 ++-- modules/mux/mp4.c | 18 +++++++-------- modules/mux/mpeg/ts.c | 6 ++--- modules/mux/ogg.c | 12 +++++----- modules/packetizer/mpeg4video.c | 4 ++-- modules/packetizer/vc1.c | 2 +- modules/stream_out/rtp.c | 2 +- .../atmo/AtmoExternalCaptureInput.cpp | 2 +- modules/video_filter/deinterlace.c | 2 +- modules/video_filter/mosaic.c | 2 +- src/extras/libc.c | 2 +- src/input/clock.c | 2 +- src/input/demux.c | 6 ++--- src/input/input.c | 10 ++++----- src/input/stream.c | 8 +++---- src/misc/mtime.c | 22 +++++++++---------- src/network/httpd.c | 2 +- src/stream_output/stream_output.c | 2 +- 60 files changed, 128 insertions(+), 131 deletions(-) diff --git a/include/vlc_common.h b/include/vlc_common.h index 4b9404dbdc..a0f7a3d066 100644 --- a/include/vlc_common.h +++ b/include/vlc_common.h @@ -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__ ) diff --git a/modules/access/cdda.c b/modules/access/cdda.c index 13c3f33444..715fd8be71 100644 --- a/modules/access/cdda.c +++ b/modules/access/cdda.c @@ -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) ); diff --git a/modules/access/cdda/info.c b/modules/access/cdda/info.c index 4033372264..425755c103 100644 --- a/modules/access/cdda/info.c +++ b/modules/access/cdda/info.c @@ -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 ) { diff --git a/modules/access/dc1394.c b/modules/access/dc1394.c index 3b9654ccf6..453fe87762 100644 --- a/modules/access/dc1394.c +++ b/modules/access/dc1394.c @@ -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; } diff --git a/modules/access/dvb/http.c b/modules/access/dvb/http.c index f3cb63925c..d65253e459 100644 --- a/modules/access/dvb/http.c +++ b/modules/access/dvb/http.c @@ -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 ) diff --git a/modules/access/file.c b/modules/access/file.c index 59d3b62c1b..79274aeac5 100644 --- a/modules/access/file.c +++ b/modules/access/file.c @@ -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; /* */ diff --git a/modules/access/ftp.c b/modules/access/ftp.c index c171b71d35..36a49c6108 100644 --- a/modules/access/ftp.c +++ b/modules/access/ftp.c @@ -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; /* */ diff --git a/modules/access/gnomevfs.c b/modules/access/gnomevfs.c index 2249139ffa..d446c03fd1 100644 --- a/modules/access/gnomevfs.c +++ b/modules/access/gnomevfs.c @@ -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; /* */ diff --git a/modules/access/mms/mmsh.c b/modules/access/mms/mmsh.c index e6eb32a745..a9779d2af7 100644 --- a/modules/access/mms/mmsh.c +++ b/modules/access/mms/mmsh.c @@ -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: diff --git a/modules/access/mms/mmstu.c b/modules/access/mms/mmstu.c index b3d7af702a..47711662dd 100644 --- a/modules/access/mms/mmstu.c +++ b/modules/access/mms/mmstu.c @@ -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: diff --git a/modules/access/rtmp/access.c b/modules/access/rtmp/access.c index 4961b74c2a..0182f8f067 100644 --- a/modules/access/rtmp/access.c +++ b/modules/access/rtmp/access.c @@ -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; /* */ diff --git a/modules/access/tcp.c b/modules/access/tcp.c index e4e3ab7854..1ae0350cbb 100644 --- a/modules/access/tcp.c +++ b/modules/access/tcp.c @@ -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; /* */ diff --git a/modules/access/v4l.c b/modules/access/v4l.c index 67172dbb66..be7ab23347 100644 --- a/modules/access/v4l.c +++ b/modules/access/v4l.c @@ -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; diff --git a/modules/access/v4l2/v4l2.c b/modules/access/v4l2/v4l2.c index 3d3cf1ed4a..fb531af398 100644 --- a/modules/access/v4l2/v4l2.c +++ b/modules/access/v4l2/v4l2.c @@ -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; diff --git a/modules/audio_output/directx.c b/modules/audio_output/directx.c index 292817bf38..22573cb130 100644 --- a/modules/audio_output/directx.c +++ b/modules/audio_output/directx.c @@ -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 */ diff --git a/modules/codec/dmo/dmo.c b/modules/codec/dmo/dmo.c index acbe5e39c0..c635a07d89 100644 --- a/modules/codec/dmo/dmo.c +++ b/modules/codec/dmo/dmo.c @@ -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; diff --git a/modules/codec/ffmpeg/encoder.c b/modules/codec/ffmpeg/encoder.c index 4963e5752d..eaa5b14023 100644 --- a/modules/codec/ffmpeg/encoder.c +++ b/modules/codec/ffmpeg/encoder.c @@ -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; diff --git a/modules/codec/ffmpeg/mux.c b/modules/codec/ffmpeg/mux.c index def43e58f1..6882402e8b 100644 --- a/modules/codec/ffmpeg/mux.c +++ b/modules/codec/ffmpeg/mux.c @@ -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 ) { diff --git a/modules/codec/ffmpeg/video.c b/modules/codec/ffmpeg/video.c index bff947dd42..d2faa83c8b 100644 --- a/modules/codec/ffmpeg/video.c +++ b/modules/codec/ffmpeg/video.c @@ -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 / diff --git a/modules/codec/flac.c b/modules/codec/flac.c index 9e0b97f69e..2d903e4fef 100644 --- a/modules/codec/flac.c +++ b/modules/codec/flac.c @@ -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); diff --git a/modules/codec/rawvideo.c b/modules/codec/rawvideo.c index d767911d64..57da0bebd6 100644 --- a/modules/codec/rawvideo.c +++ b/modules/codec/rawvideo.c @@ -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; diff --git a/modules/codec/theora.c b/modules/codec/theora.c index 225a395d06..0ac1e76963 100644 --- a/modules/codec/theora.c +++ b/modules/codec/theora.c @@ -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; diff --git a/modules/codec/x264.c b/modules/codec/x264.c index 97ec2108bd..a5c4ac4afa 100644 --- a/modules/codec/x264.c +++ b/modules/codec/x264.c @@ -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; diff --git a/modules/control/http/http.c b/modules/control/http/http.c index 42a70ba6f4..254e149792 100644 --- a/modules/control/http/http.c +++ b/modules/control/http/http.c @@ -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 ) diff --git a/modules/demux/a52.c b/modules/demux/a52.c index 27207dc82f..768860424d 100644 --- a/modules/demux/a52.c +++ b/modules/demux/a52.c @@ -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 */ diff --git a/modules/demux/dts.c b/modules/demux/dts.c index 66ee28076c..a8e9b32325 100644 --- a/modules/demux/dts.c +++ b/modules/demux/dts.c @@ -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 */ diff --git a/modules/demux/flac.c b/modules/demux/flac.c index 3d9bf2456a..edf47c0105 100644 --- a/modules/demux/flac.c +++ b/modules/demux/flac.c @@ -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 */ diff --git a/modules/demux/live555.cpp b/modules/demux/live555.cpp index 1968117073..1e985f4abc 100644 --- a/modules/demux/live555.cpp +++ b/modules/demux/live555.cpp @@ -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 ); diff --git a/modules/demux/mkv.cpp b/modules/demux/mkv.cpp index cb81202bb6..e14a94750e 100644 --- a/modules/demux/mkv.cpp +++ b/modules/demux/mkv.cpp @@ -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; } diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c index d66e173b47..16cb872646 100644 --- a/modules/demux/mp4/libmp4.c +++ b/modules/demux/mp4/libmp4.c @@ -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; diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c index 174006b7e5..6642cc0531 100644 --- a/modules/demux/mp4/mp4.c +++ b/modules/demux/mp4/mp4.c @@ -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] ); } diff --git a/modules/demux/mpc.c b/modules/demux/mpc.c index 19a9d6c11b..251df6ebdc 100644 --- a/modules/demux/mpc.c +++ b/modules/demux/mpc.c @@ -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; diff --git a/modules/demux/mpeg/m4a.c b/modules/demux/mpeg/m4a.c index 017b4e74c2..d6087fc1cf 100644 --- a/modules/demux/mpeg/m4a.c +++ b/modules/demux/mpeg/m4a.c @@ -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 ) diff --git a/modules/demux/mpeg/mpga.c b/modules/demux/mpeg/mpga.c index eccdea19d3..b49f125128 100644 --- a/modules/demux/mpeg/mpga.c +++ b/modules/demux/mpeg/mpga.c @@ -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 */ diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c index fe9441dd76..6919a8dae9 100644 --- a/modules/demux/ogg.c +++ b/modules/demux/ogg.c @@ -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 ); } } diff --git a/modules/demux/playlist/m3u.c b/modules/demux/playlist/m3u.c index ea82a3bf69..b1846062f1 100644 --- a/modules/demux/playlist/m3u.c +++ b/modules/demux/playlist/m3u.c @@ -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 ) diff --git a/modules/demux/rawdv.c b/modules/demux/rawdv.c index 8a2d25cc97..6943e617db 100644 --- a/modules/demux/rawdv.c +++ b/modules/demux/rawdv.c @@ -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; diff --git a/modules/demux/rawvid.c b/modules/demux/rawvid.c index 3183bdc0f0..023a0badb4 100644 --- a/modules/demux/rawvid.c +++ b/modules/demux/rawvid.c @@ -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; } diff --git a/modules/demux/ts.c b/modules/demux/ts.c index 8e84154a99..8fa2461d9d 100644 --- a/modules/demux/ts.c +++ b/modules/demux/ts.c @@ -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; } diff --git a/modules/demux/tta.c b/modules/demux/tta.c index db999ccd23..c2ea549b37 100644 --- a/modules/demux/tta.c +++ b/modules/demux/tta.c @@ -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: diff --git a/modules/demux/vc1.c b/modules/demux/vc1.c index 750c8f47f7..05d044218c 100644 --- a/modules/demux/vc1.c +++ b/modules/demux/vc1.c @@ -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; diff --git a/modules/gui/pda/pda.c b/modules/gui/pda/pda.c index 07d92328b3..70d046b4be 100644 --- a/modules/gui/pda/pda.c +++ b/modules/gui/pda/pda.c @@ -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 ), diff --git a/modules/gui/wince/interface.cpp b/modules/gui/wince/interface.cpp index d990fa1c72..13e8aad20e 100644 --- a/modules/gui/wince/interface.cpp +++ b/modules/gui/wince/interface.cpp @@ -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, diff --git a/modules/mux/mp4.c b/modules/mux/mp4.c index 17a411bff0..e9dc6387bb 100644 --- a/modules/mux/mp4.c +++ b/modules/mux/mp4.c @@ -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; } } if( p_stream->i_duration > 0 ) - i_bitrate_avg = I64C(8000000) * i_bitrate_avg / p_stream->i_duration; + i_bitrate_avg = INT64_C(8000000) * i_bitrate_avg / p_stream->i_duration; else i_bitrate_avg = 0; if( i_bitrate_max <= 1 ) @@ -1448,13 +1448,13 @@ static bo_t *GetStblBox( sout_mux_t *p_mux, mp4_stream_t *p_stream ) /* first, create quantified length */ for( i = 0, i_dts = 0, i_dts_q = 0; i < p_stream->i_entry_count; i++ ) { - int64_t i_dts_deq = i_dts_q * I64C(1000000) / (int64_t)i_timescale; + int64_t i_dts_deq = i_dts_q * INT64_C(1000000) / (int64_t)i_timescale; int64_t i_delta = p_stream->entry[i].i_length + i_dts - i_dts_deq; i_dts += p_stream->entry[i].i_length; p_stream->entry[i].i_length = - i_delta * (int64_t)i_timescale / I64C(1000000); + i_delta * (int64_t)i_timescale / INT64_C(1000000); i_dts_q += p_stream->entry[i].i_length; } @@ -1715,13 +1715,13 @@ static bo_t *GetMoovBox( sout_mux_t *p_mux ) if( p_sys->b_64_ext ) { bo_add_64be( elst, (p_stream->i_dts_start-p_sys->i_dts_start) * - i_movie_timescale / I64C(1000000) ); + i_movie_timescale / INT64_C(1000000) ); bo_add_64be( elst, -1 ); } else { bo_add_32be( elst, (p_stream->i_dts_start-p_sys->i_dts_start) * - i_movie_timescale / I64C(1000000) ); + i_movie_timescale / INT64_C(1000000) ); bo_add_32be( elst, -1 ); } bo_add_16be( elst, 1 ); @@ -1734,13 +1734,13 @@ static bo_t *GetMoovBox( sout_mux_t *p_mux ) if( p_sys->b_64_ext ) { bo_add_64be( elst, p_stream->i_duration * - i_movie_timescale / I64C(1000000) ); + i_movie_timescale / INT64_C(1000000) ); bo_add_64be( elst, 0 ); } else { bo_add_32be( elst, p_stream->i_duration * - i_movie_timescale / I64C(1000000) ); + i_movie_timescale / INT64_C(1000000) ); bo_add_32be( elst, 0 ); } bo_add_16be( elst, 1 ); diff --git a/modules/mux/mpeg/ts.c b/modules/mux/mpeg/ts.c index cac4d72580..02f27602c9 100644 --- a/modules/mux/mpeg/ts.c +++ b/modules/mux/mpeg/ts.c @@ -1380,11 +1380,11 @@ static int Mux( sout_mux_t *p_mux ) p_spu->i_dts - p_pcr_stream->i_pes_dts; if( ( i_spu_delay > i_shaping_delay ) && - ( i_spu_delay < I64C(100000000) ) ) + ( i_spu_delay < INT64_C(100000000) ) ) continue; - if ( ( i_spu_delay >= I64C(100000000) ) || - ( i_spu_delay < I64C(10000) ) ) + if ( ( i_spu_delay >= INT64_C(100000000) ) || + ( i_spu_delay < INT64_C(10000) ) ) { BufferChainClean( &p_stream->chain_pes ); p_stream->i_pes_dts = 0; diff --git a/modules/mux/ogg.c b/modules/mux/ogg.c index 6737e74d92..bcdc13103c 100644 --- a/modules/mux/ogg.c +++ b/modules/mux/ogg.c @@ -369,7 +369,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) SetDWLE( &p_stream->p_oggds_header->i_size, sizeof( oggds_header_t ) - 1 ); SetQWLE( &p_stream->p_oggds_header->i_time_unit, - I64C(10000000) * p_input->p_fmt->video.i_frame_rate_base / + INT64_C(10000000) * p_input->p_fmt->video.i_frame_rate_base / (int64_t)p_input->p_fmt->video.i_frame_rate ); SetQWLE( &p_stream->p_oggds_header->i_samples_per_unit, 1 ); SetDWLE( &p_stream->p_oggds_header->i_default_len, 1 ); /* ??? */ @@ -434,7 +434,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) memset( p_stream->p_oggds_header->sub_type, 0, 4 ); sprintf( p_stream->p_oggds_header->sub_type, "%-x", i_tag ); - SetQWLE( &p_stream->p_oggds_header->i_time_unit, I64C(10000000) ); + SetQWLE( &p_stream->p_oggds_header->i_time_unit, INT64_C(10000000) ); SetDWLE( &p_stream->p_oggds_header->i_default_len, 1 ); SetDWLE( &p_stream->p_oggds_header->i_buffer_size, 30*1024 ); SetQWLE( &p_stream->p_oggds_header->i_samples_per_unit, @@ -952,13 +952,13 @@ static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input ) /* number of sample from begining + current packet */ op.granulepos = ( p_data->i_dts - p_sys->i_start_dts + p_data->i_length ) * - (mtime_t)p_input->p_fmt->audio.i_rate / I64C(1000000); + (mtime_t)p_input->p_fmt->audio.i_rate / INT64_C(1000000); } else if( p_stream->p_oggds_header ) { /* number of sample from begining */ op.granulepos = ( p_data->i_dts - p_sys->i_start_dts ) * - p_stream->p_oggds_header->i_samples_per_unit / I64C(1000000); + p_stream->p_oggds_header->i_samples_per_unit / INT64_C(1000000); } } else if( p_stream->i_cat == VIDEO_ES ) @@ -969,10 +969,10 @@ static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input ) op.granulepos = ( ( p_data->i_dts - p_sys->i_start_dts ) * p_input->p_fmt->video.i_frame_rate / p_input->p_fmt->video.i_frame_rate_base / - I64C(1000000) ) << p_stream->i_keyframe_granule_shift; + INT64_C(1000000) ) << p_stream->i_keyframe_granule_shift; } else if( p_stream->p_oggds_header ) - op.granulepos = ( p_data->i_dts - p_sys->i_start_dts ) * I64C(10) / + op.granulepos = ( p_data->i_dts - p_sys->i_start_dts ) * INT64_C(10) / p_stream->p_oggds_header->i_time_unit; } else if( p_stream->i_cat == SPU_ES ) diff --git a/modules/packetizer/mpeg4video.c b/modules/packetizer/mpeg4video.c index 7928d495be..56077975ab 100644 --- a/modules/packetizer/mpeg4video.c +++ b/modules/packetizer/mpeg4video.c @@ -569,14 +569,14 @@ static int ParseVOP( decoder_t *p_dec, block_t *p_vop ) p_dec->fmt_in.video.i_frame_rate > 0 && p_dec->fmt_in.video.i_frame_rate_base > 0 ) { - p_sys->i_interpolated_pts += I64C(1000000) * + p_sys->i_interpolated_pts += INT64_C(1000000) * p_dec->fmt_in.video.i_frame_rate_base * p_vop->i_rate / INPUT_RATE_DEFAULT / p_dec->fmt_in.video.i_frame_rate; } else if( p_dec->p_sys->i_fps_num ) p_sys->i_interpolated_pts += - ( I64C(1000000) * (i_time_ref + i_time_increment - + ( INT64_C(1000000) * (i_time_ref + i_time_increment - p_sys->i_last_time - p_sys->i_last_timeincr) * p_vop->i_rate / INPUT_RATE_DEFAULT / p_dec->p_sys->i_fps_num ); diff --git a/modules/packetizer/vc1.c b/modules/packetizer/vc1.c index de44056a79..533b61e309 100644 --- a/modules/packetizer/vc1.c +++ b/modules/packetizer/vc1.c @@ -377,7 +377,7 @@ static block_t *ParseIDU( decoder_t *p_dec, block_t *p_frag ) if( p_pic->i_dts <= 0 ) p_pic->i_dts = p_sys->i_interpolated_dts; - p_sys->i_interpolated_dts += I64C(1000000) * p_dec->fmt_out.video.i_frame_rate_base / p_dec->fmt_out.video.i_frame_rate; + p_sys->i_interpolated_dts += INT64_C(1000000) * p_dec->fmt_out.video.i_frame_rate_base / p_dec->fmt_out.video.i_frame_rate; if( p_pic->i_pts <= 0 ) { if( !p_sys->sh.b_has_bframe || (p_pic->i_flags & BLOCK_FLAG_TYPE_B ) ) diff --git a/modules/stream_out/rtp.c b/modules/stream_out/rtp.c index d1de7a7d78..b0f6dd0ee0 100644 --- a/modules/stream_out/rtp.c +++ b/modules/stream_out/rtp.c @@ -1512,7 +1512,7 @@ unsigned rtp_get_num( const sout_stream_id_t *id ) void rtp_packetize_common( sout_stream_id_t *id, block_t *out, int b_marker, int64_t i_pts ) { - uint32_t i_timestamp = i_pts * (int64_t)id->i_clock_rate / I64C(1000000); + uint32_t i_timestamp = i_pts * (int64_t)id->i_clock_rate / INT64_C(1000000); out->p_buffer[0] = 0x80; out->p_buffer[1] = (b_marker?0x80:0x00)|id->i_payload_type; diff --git a/modules/video_filter/atmo/AtmoExternalCaptureInput.cpp b/modules/video_filter/atmo/AtmoExternalCaptureInput.cpp index 01071c6066..7945473338 100644 --- a/modules/video_filter/atmo/AtmoExternalCaptureInput.cpp +++ b/modules/video_filter/atmo/AtmoExternalCaptureInput.cpp @@ -127,7 +127,7 @@ DWORD CAtmoExternalCaptureInput::Execute(void) vlc_mutex_lock( &m_WakeupLock ); while ((this->m_bTerminated == ATMO_FALSE) && (this->m_pAtmoThread->b_die == false)) { - int value = vlc_cond_timedwait(&m_WakeupCond, &m_WakeupLock, mdate() + I64C(75000)); + int value = vlc_cond_timedwait(&m_WakeupCond, &m_WakeupLock, mdate() + INT64_C(75000)); if(!value) { /* DeliverNewSourceDataPaket delivered new work for me... get it! */ CalcColors(); // read picture and calculate colors diff --git a/modules/video_filter/deinterlace.c b/modules/video_filter/deinterlace.c index c799298029..1e8d55b836 100644 --- a/modules/video_filter/deinterlace.c +++ b/modules/video_filter/deinterlace.c @@ -1285,7 +1285,7 @@ static inline void XDeint8x8MergeMMXEXT( uint8_t *dst, int i_dst, uint8_t *src1, int i_src1, uint8_t *src2, int i_src2 ) { - static const uint64_t m_4 = I64C(0x0004000400040004); + static const uint64_t m_4 = INT64_C(0x0004000400040004); int y, x; /* Progressive */ diff --git a/modules/video_filter/mosaic.c b/modules/video_filter/mosaic.c index f2e75cc540..dd1ac06c07 100644 --- a/modules/video_filter/mosaic.c +++ b/modules/video_filter/mosaic.c @@ -40,7 +40,7 @@ #include "mosaic.h" -#define BLANK_DELAY I64C(1000000) +#define BLANK_DELAY INT64_C(1000000) /***************************************************************************** * Local prototypes diff --git a/src/extras/libc.c b/src/extras/libc.c index 8c5e3c20b0..9d554ca8b6 100644 --- a/src/extras/libc.c +++ b/src/extras/libc.c @@ -764,7 +764,7 @@ bool vlc_ureduce( unsigned *pi_dst_nom, unsigned *pi_dst_den, i_nom /= i_gcd; i_den /= i_gcd; - if( i_max == 0 ) i_max = I64C(0xFFFFFFFF); + if( i_max == 0 ) i_max = INT64_C(0xFFFFFFFF); if( i_nom > i_max || i_den > i_max ) { diff --git a/src/input/clock.c b/src/input/clock.c index 6c724b82d7..ce3b6d0ce3 100644 --- a/src/input/clock.c +++ b/src/input/clock.c @@ -75,7 +75,7 @@ static void ClockNewRef( input_clock_t * p_pgrm, *****************************************************************************/ /* Maximum gap allowed between two CRs. */ -#define CR_MAX_GAP (I64C(2000000)*100/9) +#define CR_MAX_GAP (INT64_C(2000000)*100/9) /* Latency introduced on DVDs with CR == 0 on chapter change - this is from * my dice --Meuuh */ diff --git a/src/input/demux.c b/src/input/demux.c index 3a47e70729..6116346c1c 100644 --- a/src/input/demux.c +++ b/src/input/demux.c @@ -219,7 +219,7 @@ int demux_vaControlHelper( stream_t *s, pi64 = (int64_t*)va_arg( args, int64_t * ); if( i_bitrate > 0 && i_end > i_start ) { - *pi64 = I64C(8000000) * (i_end - i_start) / i_bitrate; + *pi64 = INT64_C(8000000) * (i_end - i_start) / i_bitrate; return VLC_SUCCESS; } return VLC_EGENERIC; @@ -228,7 +228,7 @@ int demux_vaControlHelper( stream_t *s, pi64 = (int64_t*)va_arg( args, int64_t * ); if( i_bitrate > 0 && i_end > i_start ) { - *pi64 = I64C(8000000) * (i_tell - i_start) / i_bitrate; + *pi64 = INT64_C(8000000) * (i_tell - i_start) / i_bitrate; return VLC_SUCCESS; } return VLC_EGENERIC; @@ -262,7 +262,7 @@ int demux_vaControlHelper( stream_t *s, i64 = (int64_t)va_arg( args, int64_t ); if( i_bitrate > 0 && i64 >= 0 ) { - int64_t i_block = i64 * i_bitrate / I64C(8000000) / i_align; + int64_t i_block = i64 * i_bitrate / INT64_C(8000000) / i_align; if( stream_Seek( s, i_start + i_block * i_align ) ) { return VLC_EGENERIC; diff --git a/src/input/input.c b/src/input/input.c index 6433bd67d7..687ec79fef 100644 --- a/src/input/input.c +++ b/src/input/input.c @@ -772,7 +772,7 @@ static void MainLoop( input_thread_t *p_input ) } var_SetBool( p_input, "intf-change", true ); - i_intf_update = mdate() + I64C(150000); + i_intf_update = mdate() + INT64_C(150000); } /* 150ms * 8 = ~ 1 second */ if( ++i_updates % 8 == 0 ) @@ -952,9 +952,9 @@ static void StartTitle( input_thread_t * p_input ) /* Start time*/ /* Set start time */ - p_input->p->i_start = I64C(1000000) * var_GetInteger( p_input, "start-time" ); - p_input->p->i_stop = I64C(1000000) * var_GetInteger( p_input, "stop-time" ); - p_input->p->i_run = I64C(1000000) * var_GetInteger( p_input, "run-time" ); + p_input->p->i_start = INT64_C(1000000) * var_GetInteger( p_input, "start-time" ); + p_input->p->i_stop = INT64_C(1000000) * var_GetInteger( p_input, "stop-time" ); + p_input->p->i_run = INT64_C(1000000) * var_GetInteger( p_input, "run-time" ); i_length = var_GetTime( p_input, "length" ); if( p_input->p->i_run < 0 ) { @@ -973,7 +973,7 @@ static void StartTitle( input_thread_t * p_input ) vlc_value_t s; msg_Dbg( p_input, "starting at time: %ds", - (int)( p_input->p->i_start / I64C(1000000) ) ); + (int)( p_input->p->i_start / INT64_C(1000000) ) ); s.i_time = p_input->p->i_start; input_ControlPush( p_input, INPUT_CONTROL_SET_TIME, &s ); diff --git a/src/input/stream.c b/src/input/stream.c index 7c32f11705..f0cf57a1b1 100644 --- a/src/input/stream.c +++ b/src/input/stream.c @@ -631,13 +631,13 @@ static void AStreamPrebufferBlock( stream_t *s ) /* Update stat */ p_sys->stat.i_bytes = p_sys->block.i_size; p_sys->stat.i_read_time = i_date - i_start; - i_byterate = ( I64C(1000000) * p_sys->stat.i_bytes ) / + i_byterate = ( INT64_C(1000000) * p_sys->stat.i_bytes ) / (p_sys->stat.i_read_time + 1); msg_Dbg( s, "prebuffering done %"PRId64" bytes in %"PRId64"s - " "%"PRId64" kbytes/s", p_sys->stat.i_bytes, - p_sys->stat.i_read_time / I64C(1000000), + p_sys->stat.i_read_time / INT64_C(1000000), i_byterate / 1024 ); break; } @@ -1376,13 +1376,13 @@ static void AStreamPrebufferStream( stream_t *s ) /* Update stat */ p_sys->stat.i_bytes = tk->i_end - tk->i_start; p_sys->stat.i_read_time = i_date - i_start; - i_byterate = ( I64C(1000000) * p_sys->stat.i_bytes ) / + i_byterate = ( INT64_C(1000000) * p_sys->stat.i_bytes ) / (p_sys->stat.i_read_time+1); msg_Dbg( s, "pre-buffering done %"PRId64" bytes in %"PRId64"s - " "%"PRId64" kbytes/s", p_sys->stat.i_bytes, - p_sys->stat.i_read_time / I64C(1000000), + p_sys->stat.i_read_time / INT64_C(1000000), i_byterate / 1024 ); break; } diff --git a/src/misc/mtime.c b/src/misc/mtime.c index dfd6d73775..c2c19151cb 100644 --- a/src/misc/mtime.c +++ b/src/misc/mtime.c @@ -190,9 +190,9 @@ mtime_t mdate( void ) #elif defined( WIN32 ) || defined( UNDER_CE ) /* We don't need the real date, just the value of a high precision timer */ - static mtime_t freq = I64C(-1); + static mtime_t freq = INT64_C(-1); - if( freq == I64C(-1) ) + if( freq == INT64_C(-1) ) { /* Extract from the Tcl source code: * (http://www.cs.man.ac.uk/fellowsd-bin/TIP/7.html) @@ -215,7 +215,7 @@ mtime_t mdate( void ) LARGE_INTEGER buf; freq = ( QueryPerformanceFrequency( &buf ) && - (buf.QuadPart == I64C(1193182) || buf.QuadPart == I64C(3579545) ) ) + (buf.QuadPart == INT64_C(1193182) || buf.QuadPart == INT64_C(3579545) ) ) ? buf.QuadPart : 0; #if defined( WIN32 ) @@ -262,16 +262,16 @@ mtime_t mdate( void ) * about 49.7 days so we try to detect the wrapping. */ static CRITICAL_SECTION date_lock; - static mtime_t i_previous_time = I64C(-1); + static mtime_t i_previous_time = INT64_C(-1); static int i_wrap_counts = -1; if( i_wrap_counts == -1 ) { /* Initialization */ #if defined( WIN32 ) - i_previous_time = I64C(1000) * timeGetTime(); + i_previous_time = INT64_C(1000) * timeGetTime(); #else - i_previous_time = I64C(1000) * GetTickCount(); + i_previous_time = INT64_C(1000) * GetTickCount(); #endif InitializeCriticalSection( &date_lock ); i_wrap_counts = 0; @@ -279,17 +279,17 @@ mtime_t mdate( void ) EnterCriticalSection( &date_lock ); #if defined( WIN32 ) - res = I64C(1000) * - (i_wrap_counts * I64C(0x100000000) + timeGetTime()); + res = INT64_C(1000) * + (i_wrap_counts * INT64_C(0x100000000) + timeGetTime()); #else - res = I64C(1000) * - (i_wrap_counts * I64C(0x100000000) + GetTickCount()); + res = INT64_C(1000) * + (i_wrap_counts * INT64_C(0x100000000) + GetTickCount()); #endif if( i_previous_time > res ) { /* Counter wrapped */ i_wrap_counts++; - res += I64C(0x100000000) * 1000; + res += INT64_C(0x100000000) * 1000; } i_previous_time = res; LeaveCriticalSection( &date_lock ); diff --git a/src/network/httpd.c b/src/network/httpd.c index dad2c141d2..d96882b410 100644 --- a/src/network/httpd.c +++ b/src/network/httpd.c @@ -1399,7 +1399,7 @@ static void httpd_ClientInit( httpd_client_t *cl, mtime_t now ) { cl->i_state = HTTPD_CLIENT_RECEIVING; cl->i_activity_date = now; - cl->i_activity_timeout = I64C(10000000); + cl->i_activity_timeout = INT64_C(10000000); cl->i_buffer_size = HTTPD_CL_BUFSIZE; cl->i_buffer = 0; cl->p_buffer = malloc( cl->i_buffer_size ); diff --git a/src/stream_output/stream_output.c b/src/stream_output/stream_output.c index 4a49351845..8f4a76a1b7 100644 --- a/src/stream_output/stream_output.c +++ b/src/stream_output/stream_output.c @@ -601,7 +601,7 @@ void sout_MuxSendBuffer( sout_mux_t *p_mux, sout_input_t *p_input, if( p_mux->b_waiting_stream ) { - const int64_t i_caching = var_GetInteger( p_mux->p_sout, "sout-mux-caching" ) * I64C(1000); + const int64_t i_caching = var_GetInteger( p_mux->p_sout, "sout-mux-caching" ) * INT64_C(1000); if( p_mux->i_add_stream_start < 0 ) p_mux->i_add_stream_start = p_buffer->i_dts; -- 2.39.2