summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorOlivier Langlois <olivier@trillion01.com>2014-05-06 17:16:47 -0400
committerMichael Niedermayer <michaelni@gmx.at>2014-05-19 02:35:07 +0200
commit76191c08f88fd66cf9198afc0c4a809c4c0336d4 (patch)
treed74bac8092ca81b2abcdac087971b48dce720bdd /ffmpeg.c
parente705d0ce1cd3b428ee2d03db6517e189dc3b142d (diff)
ffmpeg: Use av_gettime_relative()
Whenever av_gettime() is used to measure relative period of time, av_gettime_relative() is prefered as it guarantee monotonic time on supported platforms. Signed-off-by: Olivier Langlois <olivier@trillion01.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 8cf9fa5988..e5d9be6245 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2430,7 +2430,7 @@ static int transcode_init(void)
InputFile *ifile = input_files[i];
if (ifile->rate_emu)
for (j = 0; j < ifile->nb_streams; j++)
- input_streams[j + ifile->ist_index]->start = av_gettime();
+ input_streams[j + ifile->ist_index]->start = av_gettime_relative();
}
/* output stream init */
@@ -3228,7 +3228,7 @@ static int get_input_packet(InputFile *f, AVPacket *pkt)
for (i = 0; i < f->nb_streams; i++) {
InputStream *ist = input_streams[f->ist_index + i];
int64_t pts = av_rescale(ist->dts, 1000000, AV_TIME_BASE);
- int64_t now = av_gettime() - ist->start;
+ int64_t now = av_gettime_relative() - ist->start;
if (pts > now)
return AVERROR(EAGAIN);
}
@@ -3594,7 +3594,7 @@ static int transcode(void)
av_log(NULL, AV_LOG_INFO, "Press [q] to stop, [?] for help\n");
}
- timer_start = av_gettime();
+ timer_start = av_gettime_relative();
#if HAVE_PTHREADS
if ((ret = init_input_threads()) < 0)
@@ -3602,7 +3602,7 @@ static int transcode(void)
#endif
while (!received_sigterm) {
- int64_t cur_time= av_gettime();
+ int64_t cur_time= av_gettime_relative();
/* if 'q' pressed, exits */
if (stdin_interaction)
@@ -3649,7 +3649,7 @@ static int transcode(void)
}
/* dump report by using the first video and audio streams */
- print_report(1, timer_start, av_gettime());
+ print_report(1, timer_start, av_gettime_relative());
/* close each encoder */
for (i = 0; i < nb_output_streams; i++) {