changeset 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 5f829140788e
children 3879e6def12f
files asf-enc.c avformat.h avienc.c ffm.c grab.c os_support.c utils.c v4l2.c
diffstat 8 files changed, 16 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/asf-enc.c	Wed Dec 06 17:17:33 2006 +0000
+++ b/asf-enc.c	Wed Dec 06 23:46:11 2006 +0000
@@ -269,8 +269,8 @@
 {
     int64_t t;
 
-    t = ti * int64_t_C(10000000);
-    t += int64_t_C(116444736000000000);
+    t = ti * INT64_C(10000000);
+    t += INT64_C(116444736000000000);
     return t;
 }
 
@@ -739,7 +739,7 @@
     pts = (pkt->pts != AV_NOPTS_VALUE) ? pkt->pts : pkt->dts;
     if (pts == AV_NOPTS_VALUE) {
         if (codec->codec_type == CODEC_TYPE_AUDIO) {
-            duration = (codec->frame_number * (int64_t)codec->frame_size * int64_t_C(10000000)) /
+            duration = (codec->frame_number * (int64_t)codec->frame_size * INT64_C(10000000)) /
                 codec->sample_rate;
         } else {
             duration = av_rescale(codec->frame_number * (int64_t)codec->time_base.num, 10000000, codec->time_base.den);
@@ -755,8 +755,8 @@
 
     /* check index */
     if ((!asf->is_streamed) && (codec->codec_type == CODEC_TYPE_VIDEO) && (pkt->flags & PKT_FLAG_KEY)) {
-        start_sec = (int)(duration / int64_t_C(10000000));
-        if (start_sec != (int)(asf->last_indexed_pts / int64_t_C(10000000))) {
+        start_sec = (int)(duration / INT64_C(10000000));
+        if (start_sec != (int)(asf->last_indexed_pts / INT64_C(10000000))) {
             for(i=asf->nb_index_count;i<start_sec;i++) {
                 if (i>=asf->nb_index_memory_alloc) {
                     asf->nb_index_memory_alloc += ASF_INDEX_BLOCK;
--- a/avformat.h	Wed Dec 06 17:17:33 2006 +0000
+++ b/avformat.h	Wed Dec 06 23:46:11 2006 +0000
@@ -40,11 +40,11 @@
 /* packet functions */
 
 #ifndef MAXINT64
-#define MAXINT64 int64_t_C(0x7fffffffffffffff)
+#define MAXINT64 INT64_C(0x7fffffffffffffff)
 #endif
 
 #ifndef MININT64
-#define MININT64 int64_t_C(0x8000000000000000)
+#define MININT64 INT64_C(0x8000000000000000)
 #endif
 
 typedef struct AVPacket {
--- a/avienc.c	Wed Dec 06 17:17:33 2006 +0000
+++ b/avienc.c	Wed Dec 06 23:46:11 2006 +0000
@@ -163,7 +163,7 @@
     nb_frames = 0;
 
     if(video_enc){
-        put_le32(pb, (uint32_t)(int64_t_C(1000000) * video_enc->time_base.num / video_enc->time_base.den));
+        put_le32(pb, (uint32_t)(INT64_C(1000000) * video_enc->time_base.num / video_enc->time_base.den));
     } else {
         put_le32(pb, 0);
     }
--- a/ffm.c	Wed Dec 06 17:17:33 2006 +0000
+++ b/ffm.c	Wed Dec 06 23:46:11 2006 +0000
@@ -469,7 +469,7 @@
         ffm->file_size = url_fsize(pb);
         adjust_write_index(s);
     } else {
-        ffm->file_size = (uint64_t_C(1) << 63) - 1;
+        ffm->file_size = (UINT64_C(1) << 63) - 1;
     }
 
     nb_streams = get_be32(pb);
--- a/grab.c	Wed Dec 06 17:17:33 2006 +0000
+++ b/grab.c	Wed Dec 06 23:46:11 2006 +0000
@@ -321,16 +321,16 @@
     struct timespec ts;
 
     /* Calculate the time of the next frame */
-    s->time_frame += int64_t_C(1000000);
+    s->time_frame += INT64_C(1000000);
 
     /* wait based on the frame rate */
     for(;;) {
         curtime = av_gettime();
         delay = s->time_frame  * s->frame_rate_base / s->frame_rate - curtime;
         if (delay <= 0) {
-            if (delay < int64_t_C(-1000000) * s->frame_rate_base / s->frame_rate) {
+            if (delay < INT64_C(-1000000) * s->frame_rate_base / s->frame_rate) {
                 /* printf("grabbing is %d frames late (dropping)\n", (int) -(delay / 16666)); */
-                s->time_frame += int64_t_C(1000000);
+                s->time_frame += INT64_C(1000000);
             }
             break;
         }
--- a/os_support.c	Wed Dec 06 17:17:33 2006 +0000
+++ b/os_support.c	Wed Dec 06 23:46:11 2006 +0000
@@ -42,11 +42,11 @@
 int64_t av_gettime(void)
 {
 #if defined(CONFIG_WINCE)
-    return timeGetTime() * int64_t_C(1000);
+    return timeGetTime() * INT64_C(1000);
 #elif defined(__MINGW32__)
     struct timeb tb;
     _ftime(&tb);
-    return ((int64_t)tb.time * int64_t_C(1000) + (int64_t)tb.millitm) * int64_t_C(1000);
+    return ((int64_t)tb.time * INT64_C(1000) + (int64_t)tb.millitm) * INT64_C(1000);
 #else
     struct timeval tv;
     gettimeofday(&tv,NULL);
--- a/utils.c	Wed Dec 06 17:17:33 2006 +0000
+++ b/utils.c	Wed Dec 06 23:46:11 2006 +0000
@@ -2758,7 +2758,7 @@
         if (duration)
             return 0;
         else
-            return now * int64_t_C(1000000);
+            return now * INT64_C(1000000);
     }
 
     if (duration) {
--- a/v4l2.c	Wed Dec 06 17:17:33 2006 +0000
+++ b/v4l2.c	Wed Dec 06 23:46:11 2006 +0000
@@ -316,7 +316,7 @@
 
     /* Image is at s->buff_start[buf.index] */
     memcpy(frame, s->buf_start[buf.index], buf.bytesused);
-    *ts = buf.timestamp.tv_sec * int64_t_C(1000000) + buf.timestamp.tv_usec;
+    *ts = buf.timestamp.tv_sec * INT64_C(1000000) + buf.timestamp.tv_usec;
 
     res = ioctl (s->fd, VIDIOC_QBUF, &buf);
     if (res < 0) {