# 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__ )
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) );
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 )
{
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 ) {
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;
}
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 )
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;
/* */
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;
/* */
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;
/* */
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:
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:
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;
/* */
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;
/* */
}
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;
/* 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;
/* 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!" );
}
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
/* 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 */
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;
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;
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 )
{
}
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 )
{
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 /
}
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 /
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;
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);
}
/* 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;
}
/* 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;
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;
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 )
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 */
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 */
(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;
/* */
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();
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,
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 */
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 );
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 );
}
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;
}
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;
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 )
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];
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 */
/* 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;
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] );
}
/* */
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 );
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;
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;
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 );
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 )
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;
}
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 */
{
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
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;
}
* 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 );
}
}
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 )
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;
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;
}
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;
}
}
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;
}
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++;
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:
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;
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 ),
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,
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;
}
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 )
/* 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;
}
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 );
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 );
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;
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 ); /* ??? */
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,
/* 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 )
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 )
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 );
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 ) )
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;
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
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 */
#include "mosaic.h"
-#define BLANK_DELAY I64C(1000000)
+#define BLANK_DELAY INT64_C(1000000)
/*****************************************************************************
* Local prototypes
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 )
{
*****************************************************************************/
/* 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 */
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;
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;
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;
}
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 )
/* 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 )
{
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 );
/* 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;
}
/* 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;
}
#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)
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 )
* 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;
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 );
{
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 );
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;