[FFmpeg-cvslog] avfilter/vf_telecine: Avoid floating point values

Himangi Saraogi git at videolan.org
Fri Mar 27 16:00:51 CET 2015


ffmpeg | branch: master | Himangi Saraogi <himangi774 at gmail.com> | Fri Mar 27 19:53:12 2015 +0530| [dbce8cdacf0c610a69cbf0d2959d793957dd4dfa] | committer: Michael Niedermayer

avfilter/vf_telecine: Avoid floating point values

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dbce8cdacf0c610a69cbf0d2959d793957dd4dfa
---

 libavfilter/vf_telecine.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavfilter/vf_telecine.c b/libavfilter/vf_telecine.c
index 73447df..93e5aa9 100644
--- a/libavfilter/vf_telecine.c
+++ b/libavfilter/vf_telecine.c
@@ -41,7 +41,7 @@ typedef struct {
     int64_t start_time;
 
     AVRational pts;
-    double ts_unit;
+    AVRational ts_unit;
     int out_cnt;
     int occupied;
 
@@ -164,7 +164,7 @@ static int config_output(AVFilterLink *outlink)
     av_log(ctx, AV_LOG_VERBOSE, "TB: %d/%d -> %d/%d\n",
            inlink->time_base.num, inlink->time_base.den, outlink->time_base.num, outlink->time_base.den);
 
-    s->ts_unit = av_q2d(av_inv_q(av_mul_q(fps, outlink->time_base)));
+    s->ts_unit = av_inv_q(av_mul_q(fps, outlink->time_base));
 
     return 0;
 }
@@ -243,7 +243,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
 
         av_frame_copy_props(frame, inpicref);
         frame->pts = ((s->start_time == AV_NOPTS_VALUE) ? 0 : s->start_time) +
-                     outlink->frame_count * s->ts_unit;
+                     av_rescale(outlink->frame_count, s->ts_unit.num,
+                                s->ts_unit.den);
         ret = ff_filter_frame(outlink, frame);
     }
     av_frame_free(&inpicref);



More information about the ffmpeg-cvslog mailing list