Changeset d1d3dc1d109110bf68cb048c429f6f05a3839200
- Timestamp:
- 05/01/08 21:11:47
(2 months ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1209669107 +0300
- git-parent:
[1379ab26f381310cd1fd34664d73a28cc9bf6eb1]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1209669107 +0300
- Message:
Remove I64C as well
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r1379ab2 |
rd1d3dc1 |
|
| 863 | 863 | #endif |
|---|
| 864 | 864 | |
|---|
| 865 | | /* 64 bits integer constant suffix */ |
|---|
| 866 | | #define I64C(x) INT64_C(x) |
|---|
| 867 | | |
|---|
| 868 | 865 | #if defined(WIN32) || defined(UNDER_CE) |
|---|
| 869 | 866 | /* win32, cl and icl support */ |
|---|
| r8aa3a9c |
rd1d3dc1 |
|
| 548 | 548 | i_size = ( p_sectors[i+1] - p_sectors[i] ) * |
|---|
| 549 | 549 | (int64_t)CDDA_DATA_SIZE; |
|---|
| 550 | | i_length += I64C(1000000) * i_size / 44100 / 4 ; |
|---|
| | 550 | i_length += INT64_C(1000000) * i_size / 44100 / 4 ; |
|---|
| 551 | 551 | } |
|---|
| 552 | 552 | |
|---|
| r7bc28ee |
rd1d3dc1 |
|
| 908 | 908 | t->i_size = i_track_frames * (int64_t) CDIO_CD_FRAMESIZE_RAW; |
|---|
| 909 | 909 | |
|---|
| 910 | | t->i_length = I64C(1000000) * t->i_size / CDDA_FREQUENCY_SAMPLE / 4; |
|---|
| | 910 | t->i_length = INT64_C(1000000) * t->i_size / CDDA_FREQUENCY_SAMPLE / 4; |
|---|
| 911 | 911 | |
|---|
| 912 | 912 | if( p_item ) |
|---|
| … | … | |
| 940 | 940 | t->i_size = i_track_frames * (int64_t) CDIO_CD_FRAMESIZE_RAW; |
|---|
| 941 | 941 | |
|---|
| 942 | | t->i_length = I64C(1000000) * t->i_size |
|---|
| | 942 | t->i_length = INT64_C(1000000) * t->i_size |
|---|
| 943 | 943 | / CDDA_FREQUENCY_SAMPLE / 4; |
|---|
| 944 | 944 | |
|---|
| r449fd28 |
rd1d3dc1 |
|
| 751 | 751 | |
|---|
| 752 | 752 | p_block->i_pts = p_block->i_dts = |
|---|
| 753 | | mdate() - I64C(1000000) * (mtime_t)i_correct / |
|---|
| | 753 | mdate() - INT64_C(1000000) * (mtime_t)i_correct / |
|---|
| 754 | 754 | 2 / p_sys->channels / p_sys->i_sample_rate; |
|---|
| 755 | 755 | return p_block; |
|---|
| r449fd28 |
rd1d3dc1 |
|
| 256 | 256 | vlc_mutex_lock( &p_sys->httpd_mutex ); |
|---|
| 257 | 257 | |
|---|
| 258 | | p_sys->i_httpd_timeout = mdate() + I64C(3000000); /* 3 s */ |
|---|
| | 258 | p_sys->i_httpd_timeout = mdate() + INT64_C(3000000); /* 3 s */ |
|---|
| 259 | 259 | p_sys->psz_request = psz_request; |
|---|
| 260 | 260 | p_sys->b_request_frontend_info = true; |
|---|
| rf94a2f9 |
rd1d3dc1 |
|
| 354 | 354 | case ACCESS_GET_PTS_DELAY: |
|---|
| 355 | 355 | pi_64 = (int64_t*)va_arg( args, int64_t * ); |
|---|
| 356 | | *pi_64 = var_GetInteger( p_access, "file-caching" ) * I64C(1000); |
|---|
| | 356 | *pi_64 = var_GetInteger( p_access, "file-caching" ) * INT64_C(1000); |
|---|
| 357 | 357 | break; |
|---|
| 358 | 358 | |
|---|
| r97897ee |
rd1d3dc1 |
|
| 550 | 550 | pi_64 = (int64_t*)va_arg( args, int64_t * ); |
|---|
| 551 | 551 | var_Get( p_access, "ftp-caching", &val ); |
|---|
| 552 | | *pi_64 = (int64_t)var_GetInteger( p_access, "ftp-caching" ) * I64C(1000); |
|---|
| | 552 | *pi_64 = (int64_t)var_GetInteger( p_access, "ftp-caching" ) * INT64_C(1000); |
|---|
| 553 | 553 | break; |
|---|
| 554 | 554 | |
|---|
| rf94a2f9 |
rd1d3dc1 |
|
| 404 | 404 | pi_64 = (int64_t*)va_arg( args, int64_t * ); |
|---|
| 405 | 405 | *pi_64 = var_GetInteger( p_access, |
|---|
| 406 | | "gnomevfs-caching" ) * I64C(1000); |
|---|
| | 406 | "gnomevfs-caching" ) * INT64_C(1000); |
|---|
| 407 | 407 | break; |
|---|
| 408 | 408 | |
|---|
| r97897ee |
rd1d3dc1 |
|
| 272 | 272 | case ACCESS_GET_PTS_DELAY: |
|---|
| 273 | 273 | pi_64 = (int64_t*)va_arg( args, int64_t * ); |
|---|
| 274 | | *pi_64 = (int64_t)var_GetInteger( p_access, "mms-caching" ) * I64C(1000); |
|---|
| | 274 | *pi_64 = (int64_t)var_GetInteger( p_access, "mms-caching" ) * INT64_C(1000); |
|---|
| 275 | 275 | break; |
|---|
| 276 | 276 | |
|---|
| r97897ee |
rd1d3dc1 |
|
| 261 | 261 | pi_64 = (int64_t*)va_arg( args, int64_t * ); |
|---|
| 262 | 262 | var_Get( p_access, "mms-caching", &val ); |
|---|
| 263 | | *pi_64 = (int64_t)var_GetInteger( p_access, "mms-caching" ) * I64C(1000); |
|---|
| | 263 | *pi_64 = (int64_t)var_GetInteger( p_access, "mms-caching" ) * INT64_C(1000); |
|---|
| 264 | 264 | break; |
|---|
| 265 | 265 | |
|---|
| rf94a2f9 |
rd1d3dc1 |
|
| 468 | 468 | case ACCESS_GET_PTS_DELAY: |
|---|
| 469 | 469 | pi_64 = (int64_t*)va_arg( args, int64_t * ); |
|---|
| 470 | | *pi_64 = var_GetInteger( p_access, "rtmp-caching" ) * I64C(1000); |
|---|
| | 470 | *pi_64 = var_GetInteger( p_access, "rtmp-caching" ) * INT64_C(1000); |
|---|
| 471 | 471 | break; |
|---|
| 472 | 472 | |
|---|
| rf94a2f9 |
rd1d3dc1 |
|
| 189 | 189 | case ACCESS_GET_PTS_DELAY: |
|---|
| 190 | 190 | pi_64 = (int64_t*)va_arg( args, int64_t * ); |
|---|
| 191 | | *pi_64 = (int64_t)var_GetInteger( p_access, "tcp-caching" ) * I64C(1000); |
|---|
| | 191 | *pi_64 = (int64_t)var_GetInteger( p_access, "tcp-caching" ) * INT64_C(1000); |
|---|
| 192 | 192 | break; |
|---|
| 193 | 193 | |
|---|
| r449fd28 |
rd1d3dc1 |
|
| 1416 | 1416 | |
|---|
| 1417 | 1417 | p_block->i_pts = p_block->i_dts = |
|---|
| 1418 | | mdate() - I64C(1000000) * (mtime_t)i_correct / |
|---|
| | 1418 | mdate() - INT64_C(1000000) * (mtime_t)i_correct / |
|---|
| 1419 | 1419 | 2 / ( p_sys->b_stereo ? 2 : 1) / p_sys->i_sample_rate; |
|---|
| 1420 | 1420 | |
|---|
| r0f79e20 |
rd1d3dc1 |
|
| 1647 | 1647 | /* Timestamp */ |
|---|
| 1648 | 1648 | p_block->i_pts = p_block->i_dts = |
|---|
| 1649 | | mdate() - I64C(1000000) * (mtime_t)i_correct / |
|---|
| | 1649 | mdate() - INT64_C(1000000) * (mtime_t)i_correct / |
|---|
| 1650 | 1650 | 2 / ( p_sys->b_stereo ? 2 : 1) / p_sys->i_sample_rate; |
|---|
| 1651 | 1651 | |
|---|
| r449fd28 |
rd1d3dc1 |
|
| 1044 | 1044 | /* Detect underruns */ |
|---|
| 1045 | 1045 | if( l_queued && mtime - last_time > |
|---|
| 1046 | | I64C(1000000) * l_queued / p_aout->output.output.i_rate ) |
|---|
| | 1046 | INT64_C(1000000) * l_queued / p_aout->output.output.i_rate ) |
|---|
| 1047 | 1047 | { |
|---|
| 1048 | 1048 | msg_Dbg( p_aout, "detected underrun!" ); |
|---|
| … | … | |
| 1059 | 1059 | { |
|---|
| 1060 | 1060 | aout_buffer_t *p_buffer = aout_OutputNextBuffer( p_aout, |
|---|
| 1061 | | mtime + I64C(1000000) * (i * FRAME_SIZE + l_queued) / |
|---|
| | 1061 | mtime + INT64_C(1000000) * (i * FRAME_SIZE + l_queued) / |
|---|
| 1062 | 1062 | p_aout->output.output.i_rate, b_sleek ); |
|---|
| 1063 | 1063 | |
|---|
| … | … | |
| 1072 | 1072 | /* Sleep a reasonable amount of time */ |
|---|
| 1073 | 1073 | l_queued += (i * FRAME_SIZE); |
|---|
| 1074 | | msleep( I64C(1000000) * l_queued / p_aout->output.output.i_rate / 2 ); |
|---|
| | 1074 | msleep( INT64_C(1000000) * l_queued / p_aout->output.output.i_rate / 2 ); |
|---|
| 1075 | 1075 | } |
|---|
| 1076 | 1076 | |
|---|
| r97897ee |
rd1d3dc1 |
|
| 1059 | 1059 | vih.rcTarget = vih.rcSource; |
|---|
| 1060 | 1060 | |
|---|
| 1061 | | vih.AvgTimePerFrame = I64C(10000000) / 25; //FIXME |
|---|
| | 1061 | vih.AvgTimePerFrame = INT64_C(10000000) / 25; //FIXME |
|---|
| 1062 | 1062 | |
|---|
| 1063 | 1063 | dmo_type.majortype = MEDIATYPE_Video; |
|---|
| r97897ee |
rd1d3dc1 |
|
| 909 | 909 | |
|---|
| 910 | 910 | /* FIXME, 3-2 pulldown is not handled correctly */ |
|---|
| 911 | | p_block->i_length = I64C(1000000) * |
|---|
| | 911 | p_block->i_length = INT64_C(1000000) * |
|---|
| 912 | 912 | p_enc->fmt_in.video.i_frame_rate_base / |
|---|
| 913 | 913 | p_enc->fmt_in.video.i_frame_rate; |
|---|
| r97897ee |
rd1d3dc1 |
|
| 364 | 364 | if( p_data->i_pts > 0 ) |
|---|
| 365 | 365 | pkt.pts = p_data->i_pts * p_stream->time_base.den / |
|---|
| 366 | | I64C(1000000) / p_stream->time_base.num; |
|---|
| | 366 | INT64_C(1000000) / p_stream->time_base.num; |
|---|
| 367 | 367 | if( p_data->i_dts > 0 ) |
|---|
| 368 | 368 | pkt.dts = p_data->i_dts * p_stream->time_base.den / |
|---|
| 369 | | I64C(1000000) / p_stream->time_base.num; |
|---|
| | 369 | INT64_C(1000000) / p_stream->time_base.num; |
|---|
| 370 | 370 | |
|---|
| 371 | 371 | /* this is another hack to prevent libavformat from triggering the "non monotone timestamps" check in avformat/utils.c */ |
|---|
| 372 | 372 | p_stream->cur_dts = ( p_data->i_dts * p_stream->time_base.den / |
|---|
| 373 | | I64C(1000000) / p_stream->time_base.num ) - 1; |
|---|
| | 373 | INT64_C(1000000) / p_stream->time_base.num ) - 1; |
|---|
| 374 | 374 | |
|---|
| 375 | 375 | if( av_write_frame( p_sys->oc, &pkt ) < 0 ) |
|---|
| r449fd28 |
rd1d3dc1 |
|
| 465 | 465 | |
|---|
| 466 | 466 | if( !p_dec->b_pace_control && (p_sys->i_late_frames > 0) && |
|---|
| 467 | | (mdate() - p_sys->i_late_frames_start > I64C(5000000)) ) |
|---|
| | 467 | (mdate() - p_sys->i_late_frames_start > INT64_C(5000000)) ) |
|---|
| 468 | 468 | { |
|---|
| 469 | 469 | if( p_sys->i_pts ) |
|---|
| … | … | |
| 677 | 677 | p_dec->fmt_in.video.i_frame_rate_base > 0 ) |
|---|
| 678 | 678 | { |
|---|
| 679 | | p_sys->i_pts += I64C(1000000) * |
|---|
| | 679 | p_sys->i_pts += INT64_C(1000000) * |
|---|
| 680 | 680 | (2 + p_sys->p_ff_pic->repeat_pict) * |
|---|
| 681 | 681 | p_dec->fmt_in.video.i_frame_rate_base * |
|---|
| … | … | |
| 685 | 685 | else if( p_sys->p_context->time_base.den > 0 ) |
|---|
| 686 | 686 | { |
|---|
| 687 | | p_sys->i_pts += I64C(1000000) * |
|---|
| | 687 | p_sys->i_pts += INT64_C(1000000) * |
|---|
| 688 | 688 | (2 + p_sys->p_ff_pic->repeat_pict) * |
|---|
| 689 | 689 | p_sys->p_context->time_base.num * |
|---|
| r449fd28 |
rd1d3dc1 |
|
| 1016 | 1016 | { |
|---|
| 1017 | 1017 | i_sample_number = read_utf8( &p_buf[i_header++], &i_read ); |
|---|
| 1018 | | if( i_sample_number == I64C(0xffffffffffffffff) ) return 0; |
|---|
| | 1018 | if( i_sample_number == INT64_C(0xffffffffffffffff) ) return 0; |
|---|
| 1019 | 1019 | } |
|---|
| 1020 | 1020 | else |
|---|
| 1021 | 1021 | { |
|---|
| 1022 | 1022 | i_sample_number = read_utf8( &p_buf[i_header++], &i_read ); |
|---|
| 1023 | | if( i_sample_number == I64C(0xffffffffffffffff) ) return 0; |
|---|
| | 1023 | if( i_sample_number == INT64_C(0xffffffffffffffff) ) return 0; |
|---|
| 1024 | 1024 | |
|---|
| 1025 | 1025 | if( p_sys->b_stream_info ) |
|---|
| … | … | |
| 1106 | 1106 | } |
|---|
| 1107 | 1107 | else { |
|---|
| 1108 | | return I64C(0xffffffffffffffff); |
|---|
| | 1108 | return INT64_C(0xffffffffffffffff); |
|---|
| 1109 | 1109 | } |
|---|
| 1110 | 1110 | |
|---|
| … | … | |
| 1113 | 1113 | if( !(p_buf[j] & 0x80) || (p_buf[j] & 0x40) ) /* 10xxxxxx */ |
|---|
| 1114 | 1114 | { |
|---|
| 1115 | | return I64C(0xffffffffffffffff); |
|---|
| | 1115 | return INT64_C(0xffffffffffffffff); |
|---|
| 1116 | 1116 | } |
|---|
| 1117 | 1117 | i_result <<= 6; |
|---|
| r449fd28 |
rd1d3dc1 |
|
| 249 | 249 | |
|---|
| 250 | 250 | /* Date management: 1 frame per packet */ |
|---|
| 251 | | p_sys->i_pts += ( I64C(1000000) * 1.0 / 25 /*FIXME*/ ); |
|---|
| | 251 | p_sys->i_pts += ( INT64_C(1000000) * 1.0 / 25 /*FIXME*/ ); |
|---|
| 252 | 252 | *pp_block = NULL; |
|---|
| 253 | 253 | |
|---|
| r449fd28 |
rd1d3dc1 |
|
| 444 | 444 | |
|---|
| 445 | 445 | /* Date management */ |
|---|
| 446 | | p_sys->i_pts += ( I64C(1000000) * p_sys->ti.fps_denominator / |
|---|
| | 446 | p_sys->i_pts += ( INT64_C(1000000) * p_sys->ti.fps_denominator / |
|---|
| 447 | 447 | p_sys->ti.fps_numerator ); /* 1 frame per packet */ |
|---|
| 448 | 448 | |
|---|
| rd578086 |
rd1d3dc1 |
|
| 1338 | 1338 | |
|---|
| 1339 | 1339 | /* This isn't really valid for streams with B-frames */ |
|---|
| 1340 | | p_block->i_length = I64C(1000000) * |
|---|
| | 1340 | p_block->i_length = INT64_C(1000000) * |
|---|
| 1341 | 1341 | p_enc->fmt_in.video.i_frame_rate_base / |
|---|
| 1342 | 1342 | p_enc->fmt_in.video.i_frame_rate; |
|---|
| r97897ee |
rd1d3dc1 |
|
| 443 | 443 | sprintf( position, "%d" , (int)((val.f_float) * 100.0)); |
|---|
| 444 | 444 | var_Get( p_sys->p_input, "time", &val); |
|---|
| 445 | | sprintf( time, "%"PRIi64, (int64_t)val.i_time / I64C(1000000) ); |
|---|
| | 445 | sprintf( time, "%"PRIi64, (int64_t)val.i_time / INT64_C(1000000) ); |
|---|
| 446 | 446 | var_Get( p_sys->p_input, "length", &val); |
|---|
| 447 | | sprintf( length, "%"PRIi64, (int64_t)val.i_time / I64C(1000000) ); |
|---|
| | 447 | sprintf( length, "%"PRIi64, (int64_t)val.i_time / INT64_C(1000000) ); |
|---|
| 448 | 448 | |
|---|
| 449 | 449 | var_Get( p_sys->p_input, "state", &val ); |
|---|
| r2ea3b5f |
rd1d3dc1 |
|
| 228 | 228 | { |
|---|
| 229 | 229 | p_sys->i_mux_rate = |
|---|
| 230 | | p_block_out->i_buffer * I64C(1000000)/p_block_out->i_length; |
|---|
| | 230 | p_block_out->i_buffer * INT64_C(1000000)/p_block_out->i_length; |
|---|
| 231 | 231 | } |
|---|
| 232 | 232 | |
|---|
| r2ea3b5f |
rd1d3dc1 |
|
| 209 | 209 | { |
|---|
| 210 | 210 | p_sys->i_mux_rate = |
|---|
| 211 | | p_block_out->i_buffer * I64C(1000000) / p_block_out->i_length; |
|---|
| | 211 | p_block_out->i_buffer * INT64_C(1000000) / p_block_out->i_length; |
|---|
| 212 | 212 | } |
|---|
| 213 | 213 | |
|---|
| r2ea3b5f |
rd1d3dc1 |
|
| 317 | 317 | |
|---|
| 318 | 318 | /* XXX We do exact seek if it's not too far away(45s) */ |
|---|
| 319 | | if( i_delta_time < 45*I64C(1000000) ) |
|---|
| | 319 | if( i_delta_time < 45*INT64_C(1000000) ) |
|---|
| 320 | 320 | { |
|---|
| 321 | 321 | if( stream_Seek( p_demux->s, p_sys->seekpoint[i]->i_byte_offset+p_sys->i_data_pos ) ) |
|---|
| … | … | |
| 463 | 463 | ParseStreamInfo( p_demux, &i_sample_rate, &i_sample_count, *pp_streaminfo, *pi_streaminfo ); |
|---|
| 464 | 464 | if( i_sample_rate > 0 ) |
|---|
| 465 | | p_sys->i_length = i_sample_count * I64C(1000000)/i_sample_rate; |
|---|
| | 465 | p_sys->i_length = i_sample_count * INT64_C(1000000)/i_sample_rate; |
|---|
| 466 | 466 | |
|---|
| 467 | 467 | /* Be sure we have seekpoint 0 */ |
|---|
| … | … | |
| 517 | 517 | |
|---|
| 518 | 518 | *pi_rate = GetDWBE(&p_data[i_skip+4+6]) >> 12; |
|---|
| 519 | | *pi_count = GetQWBE(&p_data[i_skip+4+6]) & ((I64C(1)<<36)-1); |
|---|
| | 519 | *pi_count = GetQWBE(&p_data[i_skip+4+6]) & ((INT64_C(1)<<36)-1); |
|---|
| 520 | 520 | } |
|---|
| 521 | 521 | |
|---|
| … | … | |
| 540 | 540 | |
|---|
| 541 | 541 | s = vlc_seekpoint_New(); |
|---|
| 542 | | s->i_time_offset = i_sample * I64C(1000000)/i_sample_rate; |
|---|
| | 542 | s->i_time_offset = i_sample * INT64_C(1000000)/i_sample_rate; |
|---|
| 543 | 543 | s->i_byte_offset = GetQWBE( &p_data[4+18*i+8] ); |
|---|
| 544 | 544 | |
|---|
| r1379ab2 |
rd1d3dc1 |
|
| 1383 | 1383 | case DEMUX_SET_PAUSE_STATE: |
|---|
| 1384 | 1384 | { |
|---|
| 1385 | | double d_npt = (double) p_sys->i_npt / I64C(1000000); |
|---|
| | 1385 | double d_npt = (double) p_sys->i_npt / INT64_C(1000000); |
|---|
| 1386 | 1386 | int i; |
|---|
| 1387 | 1387 | |
|---|
| r97897ee |
rd1d3dc1 |
|
| 4869 | 4869 | { |
|---|
| 4870 | 4870 | KaxChapterTimeStart &start =*(KaxChapterTimeStart*)l; |
|---|
| 4871 | | chapters.i_start_time = uint64( start ) / I64C(1000); |
|---|
| | 4871 | chapters.i_start_time = uint64( start ) / INT64_C(1000); |
|---|
| 4872 | 4872 | |
|---|
| 4873 | 4873 | msg_Dbg( &sys.demuxer, "| | | | + ChapterTimeStart: %lld", chapters.i_start_time ); |
|---|
| … | … | |
| 4876 | 4876 | { |
|---|
| 4877 | 4877 | KaxChapterTimeEnd &end =*(KaxChapterTimeEnd*)l; |
|---|
| 4878 | | chapters.i_end_time = uint64( end ) / I64C(1000); |
|---|
| | 4878 | chapters.i_end_time = uint64( end ) / INT64_C(1000); |
|---|
| 4879 | 4879 | |
|---|
| 4880 | 4880 | msg_Dbg( &sys.demuxer, "| | | | + ChapterTimeEnd: %lld", chapters.i_end_time ); |
|---|
| … | … | |
| 5081 | 5081 | { |
|---|
| 5082 | 5082 | /* update the duration of the segment according to the sum of all sub chapters */ |
|---|
| 5083 | | i_dur = stored_editions[i_default_edition]->Duration() / I64C(1000); |
|---|
| | 5083 | i_dur = stored_editions[i_default_edition]->Duration() / INT64_C(1000); |
|---|
| 5084 | 5084 | if (i_dur > 0) |
|---|
| 5085 | 5085 | i_duration = i_dur; |
|---|
| r97897ee |
rd1d3dc1 |
|
| 155 | 155 | |
|---|
| 156 | 156 | /* date begin at 1 jan 1904 */ |
|---|
| 157 | | i_date += ((I64C(1904) * 365) + 17) * 24 * 60 * 60; |
|---|
| | 157 | i_date += ((INT64_C(1904) * 365) + 17) * 24 * 60 * 60; |
|---|
| 158 | 158 | |
|---|
| 159 | 159 | i_day = i_date / ( 60*60*24); |
|---|
| r97897ee |
rd1d3dc1 |
|
| 230 | 230 | } |
|---|
| 231 | 231 | |
|---|
| 232 | | return I64C(1000000) * i_dts / p_track->i_timescale; |
|---|
| | 232 | return INT64_C(1000000) * i_dts / p_track->i_timescale; |
|---|
| 233 | 233 | } |
|---|
| 234 | 234 | |
|---|
| … | … | |
| 245 | 245 | { |
|---|
| 246 | 246 | if( i_sample < ck->p_sample_count_pts[i_index] ) |
|---|
| 247 | | return ck->p_sample_offset_pts[i_index] * I64C(1000000) / |
|---|
| | 247 | return ck->p_sample_offset_pts[i_index] * INT64_C(1000000) / |
|---|
| 248 | 248 | (int64_t)p_track->i_timescale; |
|---|
| 249 | 249 | |
|---|
| … | … | |
| 254 | 254 | static inline int64_t MP4_GetMoviePTS(demux_sys_t *p_sys ) |
|---|
| 255 | 255 | { |
|---|
| 256 | | return I64C(1000000) * p_sys->i_time / p_sys->i_timescale; |
|---|
| | 256 | return INT64_C(1000000) * p_sys->i_time / p_sys->i_timescale; |
|---|
| 257 | 257 | } |
|---|
| 258 | 258 | |
|---|
| … | … | |
| 1755 | 1755 | /* now calculate i_start for this elst */ |
|---|
| 1756 | 1756 | /* offset */ |
|---|
| 1757 | | i_start -= p_track->i_elst_time * I64C(1000000) / p_sys->i_timescale; |
|---|
| | 1757 | i_start -= p_track->i_elst_time * INT64_C(1000000) / p_sys->i_timescale; |
|---|
| 1758 | 1758 | if( i_start < 0 ) |
|---|
| 1759 | 1759 | { |
|---|
| … | … | |
| 2053 | 2053 | elst->i_media_time[i] >= 0 ? |
|---|
| 2054 | 2054 | (int64_t)(elst->i_media_time[i] * 1000 / p_track->i_timescale) : |
|---|
| 2055 | | I64C(-1), |
|---|
| | 2055 | INT64_C(-1), |
|---|
| 2056 | 2056 | elst->i_media_rate_integer[i], |
|---|
| 2057 | 2057 | elst->i_media_rate_fraction[i] ); |
|---|
| r57bbabb |
rd1d3dc1 |
|
| 227 | 227 | p_data->i_buffer = i_ret * sizeof(MPC_SAMPLE_FORMAT) * p_sys->info.channels; |
|---|
| 228 | 228 | p_data->i_dts = p_data->i_pts = |
|---|
| 229 | | 1 + I64C(1000000) * p_sys->i_position / p_sys->info.sample_freq; |
|---|
| | 229 | 1 + INT64_C(1000000) * p_sys->i_position / p_sys->info.sample_freq; |
|---|
| 230 | 230 | |
|---|
| 231 | 231 | es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_data->i_dts ); |
|---|
| … | … | |
| 258 | 258 | case DEMUX_GET_LENGTH: |
|---|
| 259 | 259 | pi64 = (int64_t*)va_arg( args, int64_t * ); |
|---|
| 260 | | *pi64 = I64C(1000000) * p_sys->info.pcm_samples / |
|---|
| | 260 | *pi64 = INT64_C(1000000) * p_sys->info.pcm_samples / |
|---|
| 261 | 261 | p_sys->info.sample_freq; |
|---|
| 262 | 262 | return VLC_SUCCESS; |
|---|
| … | … | |
| 273 | 273 | case DEMUX_GET_TIME: |
|---|
| 274 | 274 | pi64 = (int64_t*)va_arg( args, int64_t * ); |
|---|
| 275 | | *pi64 = I64C(1000000) * p_sys->i_position / |
|---|
| | 275 | *pi64 = INT64_C(1000000) * p_sys->i_position / |
|---|
| 276 | 276 | p_sys->info.sample_freq; |
|---|
| 277 | 277 | return VLC_SUCCESS; |
|---|
| r57bbabb |
rd1d3dc1 |
|
| 165 | 165 | |
|---|
| 166 | 166 | p_sys->i_pts = p_block_out->i_pts; |
|---|
| 167 | | if( p_sys->i_pts > M4A_PTS_START + I64C(500000) ) |
|---|
| | 167 | if( p_sys->i_pts > M4A_PTS_START + INT64_C(500000) ) |
|---|
| 168 | 168 | p_sys->i_bitrate_avg = |
|---|
| 169 | | 8*I64C(1000000)*p_sys->i_bytes/(p_sys->i_pts-M4A_PTS_START); |
|---|
| | 169 | 8*INT64_C(1000000)*p_sys->i_bytes/(p_sys->i_pts-M4A_PTS_START); |
|---|
| 170 | 170 | |
|---|
| 171 | 171 | p_sys->i_bytes += p_block_out->i_buffer; |
|---|
| … | … | |
| 208 | 208 | i_ret == VLC_SUCCESS && p_sys->i_bitrate_avg > 0 ) |
|---|
| 209 | 209 | { |
|---|
| 210 | | int64_t i_time = I64C(8000000) * stream_Tell(p_demux->s) / |
|---|
| | 210 | int64_t i_time = INT64_C(8000000) * stream_Tell(p_demux->s) / |
|---|
| 211 | 211 | p_sys->i_bitrate_avg; |
|---|
| 212 | 212 | |
|---|
| r57bbabb |
rd1d3dc1 |
|
| 245 | 245 | p_sys->i_xing_frame_samples ) |
|---|
| 246 | 246 | { |
|---|
| 247 | | p_sys->i_bitrate_avg = p_sys->i_xing_bytes * I64C(8) * |
|---|
| | 247 | p_sys->i_bitrate_avg = p_sys->i_xing_bytes * INT64_C(8) * |
|---|
| 248 | 248 | p_sys->p_packetizer->fmt_out.audio.i_rate / |
|---|
| 249 | 249 | p_sys->i_xing_frames / p_sys->i_xing_frame_samples; |
|---|
| … | … | |
| 390 | 390 | (i_query == DEMUX_SET_POSITION || i_query == DEMUX_SET_TIME) ) |
|---|
| 391 | 391 | { |
|---|
| 392 | | int64_t i_time = I64C(8000000) * stream_Tell(p_demux->s) / |
|---|
| | 392 | int64_t i_time = INT64_C(8000000) * stream_Tell(p_demux->s) / |
|---|
| 393 | 393 | p_sys->i_bitrate_avg; |
|---|
| 394 | 394 | |
|---|
| r97897ee |
rd1d3dc1 |
|
| 446 | 446 | if( p_stream->fmt.i_codec != VLC_FOURCC( 't','h','e','o' ) ) |
|---|
| 447 | 447 | { |
|---|
| 448 | | p_stream->i_pcr = p_oggpacket->granulepos * I64C(1000000) |
|---|
| | 448 | p_stream->i_pcr = p_oggpacket->granulepos * INT64_C(1000000) |
|---|
| 449 | 449 | / p_stream->f_rate; |
|---|
| 450 | 450 | } |
|---|
| … | … | |
| 456 | 456 | ( iframe << p_stream->i_theora_keyframe_granule_shift ); |
|---|
| 457 | 457 | |
|---|
| 458 | | p_stream->i_pcr = ( iframe + pframe ) * I64C(1000000) |
|---|
| | 458 | p_stream->i_pcr = ( iframe + pframe ) * INT64_C(1000000) |
|---|
| 459 | 459 | / p_stream->f_rate; |
|---|
| 460 | 460 | } |
|---|
| … | … | |
| 470 | 470 | if( p_stream->fmt.i_cat == VIDEO_ES ) |
|---|
| 471 | 471 | /* 1 frame per packet */ |
|---|
| 472 | | p_stream->i_interpolated_pcr += (I64C(1000000) / p_stream->f_rate); |
|---|
| | 472 | p_stream->i_interpolated_pcr += (INT64_C(1000000) / p_stream->f_rate); |
|---|
| 473 | 473 | else if( p_stream->fmt.i_bitrate ) |
|---|
| 474 | 474 | p_stream->i_interpolated_pcr += |
|---|
| 475 | | ( p_oggpacket->bytes * I64C(1000000) / |
|---|
| | 475 | ( p_oggpacket->bytes * INT64_C(1000000) / |
|---|
| 476 | 476 | p_stream->fmt.i_bitrate / 8 ); |
|---|
| 477 | 477 | } |
|---|
| r7bc28ee |
rd1d3dc1 |
|
| 144 | 144 | parseEXTINF( psz_parse, &psz_artist, &psz_name, &i_parsed_duration ); |
|---|
| 145 | 145 | if( i_parsed_duration >= 0 ) |
|---|
| 146 | | i_duration = i_parsed_duration * I64C(1000000); |
|---|
| | 146 | i_duration = i_parsed_duration * INT64_C(1000000); |
|---|
| 147 | 147 | if( psz_name ) |
|---|
| 148 | 148 | psz_name = strdup( psz_name ); |
|---|
| r2ea3b5f |
rd1d3dc1 |
|
| 328 | 328 | if( !p_sys->b_hurry_up ) |
|---|
| 329 | 329 | { |
|---|
| 330 | | p_sys->i_pcr += ( I64C(1000000) / p_sys->f_rate ); |
|---|
| | 330 | p_sys->i_pcr += ( INT64_C(1000000) / p_sys->f_rate ); |
|---|
| 331 | 331 | } |
|---|
| 332 | 332 | |
|---|
| r57bbabb |
rd1d3dc1 |
|
| 381 | 381 | es_out_Send( p_demux->out, p_sys->p_es_video, p_block ); |
|---|
| 382 | 382 | |
|---|
| 383 | | p_sys->i_pcr += ( I64C(1000000) / p_sys->f_fps ); |
|---|
| | 383 | p_sys->i_pcr += ( INT64_C(1000000) / p_sys->f_fps ); |
|---|
| 384 | 384 | |
|---|
| 385 | 385 | return 1; |
|---|
| r97897ee |
rd1d3dc1 |
|
| 1191 | 1191 | { |
|---|
| 1192 | 1192 | if( pi_length ) |
|---|
| 1193 | | *pi_length = p_sys->i_dvb_length * I64C(1000000); |
|---|
| | 1193 | *pi_length = p_sys->i_dvb_length * INT64_C(1000000); |
|---|
| 1194 | 1194 | if( pi_time ) |
|---|
| 1195 | | *pi_time = (t - p_sys->i_dvb_start) * I64C(1000000); |
|---|
| | 1195 | *pi_time = (t - p_sys->i_dvb_start) * INT64_C(1000000); |
|---|
| 1196 | 1196 | return VLC_SUCCESS; |
|---|
| 1197 | 1197 | } |
|---|
| … | … | |
| 1256 | 1256 | if( p_sys->i_mux_rate > 0 ) |
|---|
| 1257 | 1257 | { |
|---|
| 1258 | | *pi64 = I64C(1000000) * ( stream_Size( p_demux->s ) / 50 ) / |
|---|
| | 1258 | *pi64 = INT64_C(1000000) * ( stream_Size( p_demux->s ) / 50 ) / |
|---|
| 1259 | 1259 | p_sys->i_mux_rate; |
|---|
| 1260 | 1260 | return VLC_SUCCESS; |
|---|
| r57bbabb |
rd1d3dc1 |
|
| 195 | 195 | p_data = stream_Block( p_demux->s, p_sys->pi_seektable[p_sys->i_currentframe] ); |
|---|
| 196 | 196 | if( p_data == NULL ) return 0; |
|---|
| 197 | | p_data->i_dts = p_data->i_pts = (int64_t)(1 + I64C(1000000) * p_sys->i_currentframe) * TTA_FRAMETIME; |
|---|
| | 197 | p_data->i_dts = p_data->i_pts = (int64_t)(1 + INT64_C(1000000) * p_sys->i_currentframe) * TTA_FRAMETIME; |
|---|
| 198 | 198 | |
|---|
| 199 | 199 | p_sys->i_currentframe++; |
|---|
| … | … | |
| 249 | 249 | case DEMUX_GET_LENGTH: |
|---|
| 250 | 250 | pi64 = (int64_t*)va_arg( args, int64_t * ); |
|---|
| 251 | | *pi64 = I64C(1000000) * p_sys->i_totalframes * TTA_FRAMETIME; |
|---|
| | 251 | *pi64 = INT64_C(1000000) * p_sys->i_totalframes * TTA_FRAMETIME; |
|---|
| 252 | 252 | return VLC_SUCCESS; |
|---|
| 253 | 253 | |
|---|
| 254 | 254 | case DEMUX_GET_TIME: |
|---|
| 255 | 255 | pi64 = (int64_t*)va_arg( args, int64_t * ); |
|---|
| 256 | | *pi64 = I64C(1000000) * p_sys->i_currentframe * TTA_FRAMETIME; |
|---|
| | 256 | *pi64 = INT64_C(1000000) * p_sys->i_currentframe * TTA_FRAMETIME; |
|---|
| 257 | 257 | return VLC_SUCCESS; |
|---|
| 258 | 258 | |
|---|