diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-12-14 20:24:21 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-12-14 20:37:26 +0100 |
commit | 1925eaeaa6f2582660571701d4f20d102b960e4a (patch) | |
tree | 722684597c3f7cf6ea2a64281b6e5b8a36c83ac5 /libavfilter | |
parent | 997de2e8107cc4256e50611463d609b18fe9619f (diff) | |
download | ffmpeg-1925eaeaa6f2582660571701d4f20d102b960e4a.tar.gz |
avfilter/vf_decimate: change ts_unit to AVRational
This might help with rounding differences between platforms
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_decimate.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavfilter/vf_decimate.c b/libavfilter/vf_decimate.c index 26f3ce0935..e580d05027 100644 --- a/libavfilter/vf_decimate.c +++ b/libavfilter/vf_decimate.c @@ -42,7 +42,7 @@ typedef struct { AVFrame *last; ///< last frame from the previous queue AVFrame **clean_src; ///< frame queue for the clean source int got_frame[2]; ///< frame request flag for each input stream - double ts_unit; ///< timestamp units for the output frames + AVRational ts_unit; ///< timestamp units for the output frames int64_t start_pts; ///< base for output timestamps uint32_t eof; ///< bitmask for end of stream int hsub, vsub; ///< chroma subsampling values @@ -217,7 +217,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) av_frame_free(&frame); frame = dm->clean_src[i]; } - frame->pts = outlink->frame_count * dm->ts_unit + + frame->pts = av_rescale_q(outlink->frame_count, dm->ts_unit, (AVRational){1,0}) + (dm->start_pts == AV_NOPTS_VALUE ? 0 : dm->start_pts); ret = ff_filter_frame(outlink, frame); if (ret < 0) @@ -377,7 +377,7 @@ static int config_output(AVFilterLink *outlink) outlink->sample_aspect_ratio = inlink->sample_aspect_ratio; outlink->w = inlink->w; outlink->h = inlink->h; - dm->ts_unit = av_q2d(av_inv_q(av_mul_q(fps, outlink->time_base))); + dm->ts_unit = av_inv_q(av_mul_q(fps, outlink->time_base)); return 0; } |