summaryrefslogtreecommitdiff
path: root/avconv.c
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2012-05-10 12:19:10 +0100
committerMans Rullgard <mans@mansr.com>2012-05-10 22:54:27 +0100
commit4f1500689d662cfe08bff6d949f7fb49311024da (patch)
treee2056d37f05397ad61d23414869aa58e3ba87bef /avconv.c
parent110d0cdc9d1ec414a658f841a3fbefbf6f796d61 (diff)
avconv: use lrint() for rounding double timestamps
Converting the double to float for lrintf() loses precision when the value is not exactly representable as a single-precision float. Apart from being inaccurate, this causes discrepancies in some configurations due to differences in rounding. Note that the changed timestamp in the vc1-ism test is a bogus, made-up value. Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'avconv.c')
-rw-r--r--avconv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/avconv.c b/avconv.c
index 1aed70413b..c157778869 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1697,10 +1697,10 @@ static void do_video_out(AVFormatContext *s,
if (delta <= -0.6)
nb_frames = 0;
else if (delta > 0.6)
- ost->sync_opts = lrintf(sync_ipts);
+ ost->sync_opts = lrint(sync_ipts);
break;
case VSYNC_PASSTHROUGH:
- ost->sync_opts = lrintf(sync_ipts);
+ ost->sync_opts = lrint(sync_ipts);
break;
default:
av_assert0(0);