Mercurial > libavformat.hg
comparison asf-enc.c @ 1556:65b7b3ff4ed7 libavformat
use the standard INT64_C() macro for 64-bit constants
author | mru |
---|---|
date | Wed, 06 Dec 2006 23:46:11 +0000 |
parents | 3b00fb8ef8e4 |
children | ac2a299df031 |
comparison
equal
deleted
inserted
replaced
1555:5f829140788e | 1556:65b7b3ff4ed7 |
---|---|
267 /* convert from unix to windows time */ | 267 /* convert from unix to windows time */ |
268 static int64_t unix_to_file_time(int ti) | 268 static int64_t unix_to_file_time(int ti) |
269 { | 269 { |
270 int64_t t; | 270 int64_t t; |
271 | 271 |
272 t = ti * int64_t_C(10000000); | 272 t = ti * INT64_C(10000000); |
273 t += int64_t_C(116444736000000000); | 273 t += INT64_C(116444736000000000); |
274 return t; | 274 return t; |
275 } | 275 } |
276 | 276 |
277 /* write the header (used two times if non streamed) */ | 277 /* write the header (used two times if non streamed) */ |
278 static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data_chunk_size) | 278 static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data_chunk_size) |
737 | 737 |
738 //XXX /FIXME use duration from AVPacket (quick hack by) | 738 //XXX /FIXME use duration from AVPacket (quick hack by) |
739 pts = (pkt->pts != AV_NOPTS_VALUE) ? pkt->pts : pkt->dts; | 739 pts = (pkt->pts != AV_NOPTS_VALUE) ? pkt->pts : pkt->dts; |
740 if (pts == AV_NOPTS_VALUE) { | 740 if (pts == AV_NOPTS_VALUE) { |
741 if (codec->codec_type == CODEC_TYPE_AUDIO) { | 741 if (codec->codec_type == CODEC_TYPE_AUDIO) { |
742 duration = (codec->frame_number * (int64_t)codec->frame_size * int64_t_C(10000000)) / | 742 duration = (codec->frame_number * (int64_t)codec->frame_size * INT64_C(10000000)) / |
743 codec->sample_rate; | 743 codec->sample_rate; |
744 } else { | 744 } else { |
745 duration = av_rescale(codec->frame_number * (int64_t)codec->time_base.num, 10000000, codec->time_base.den); | 745 duration = av_rescale(codec->frame_number * (int64_t)codec->time_base.num, 10000000, codec->time_base.den); |
746 } | 746 } |
747 } else { | 747 } else { |
753 packet_st = asf->nb_packets; | 753 packet_st = asf->nb_packets; |
754 put_frame(s, stream, pkt->pts, pkt->data, pkt->size, pkt->flags); | 754 put_frame(s, stream, pkt->pts, pkt->data, pkt->size, pkt->flags); |
755 | 755 |
756 /* check index */ | 756 /* check index */ |
757 if ((!asf->is_streamed) && (codec->codec_type == CODEC_TYPE_VIDEO) && (pkt->flags & PKT_FLAG_KEY)) { | 757 if ((!asf->is_streamed) && (codec->codec_type == CODEC_TYPE_VIDEO) && (pkt->flags & PKT_FLAG_KEY)) { |
758 start_sec = (int)(duration / int64_t_C(10000000)); | 758 start_sec = (int)(duration / INT64_C(10000000)); |
759 if (start_sec != (int)(asf->last_indexed_pts / int64_t_C(10000000))) { | 759 if (start_sec != (int)(asf->last_indexed_pts / INT64_C(10000000))) { |
760 for(i=asf->nb_index_count;i<start_sec;i++) { | 760 for(i=asf->nb_index_count;i<start_sec;i++) { |
761 if (i>=asf->nb_index_memory_alloc) { | 761 if (i>=asf->nb_index_memory_alloc) { |
762 asf->nb_index_memory_alloc += ASF_INDEX_BLOCK; | 762 asf->nb_index_memory_alloc += ASF_INDEX_BLOCK; |
763 asf->index_ptr = (ASFIndex*)av_realloc( asf->index_ptr, sizeof(ASFIndex) * asf->nb_index_memory_alloc ); | 763 asf->index_ptr = (ASFIndex*)av_realloc( asf->index_ptr, sizeof(ASFIndex) * asf->nb_index_memory_alloc ); |
764 } | 764 } |