Commit 46b64e30 authored by Michael Niedermayer's avatar Michael Niedermayer

Revert "avfilter/vf_interlace: more accurate pts calculation"

This reverts commit df8248f6.

the revert produces a timebase and timestamps that are more close
to what users expect

Hoped-by: koda
parent 59f1f764
...@@ -109,6 +109,7 @@ static int config_out_props(AVFilterLink *outlink) ...@@ -109,6 +109,7 @@ static int config_out_props(AVFilterLink *outlink)
outlink->time_base = inlink->time_base; outlink->time_base = inlink->time_base;
outlink->frame_rate = inlink->frame_rate; outlink->frame_rate = inlink->frame_rate;
// half framerate // half framerate
outlink->time_base.num *= 2;
outlink->frame_rate.den *= 2; outlink->frame_rate.den *= 2;
outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP; outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
...@@ -204,6 +205,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) ...@@ -204,6 +205,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
av_frame_copy_props(out, s->cur); av_frame_copy_props(out, s->cur);
out->interlaced_frame = 1; out->interlaced_frame = 1;
out->top_field_first = tff; out->top_field_first = tff;
out->pts /= 2; // adjust pts to new framerate
/* copy upper/lower field from cur */ /* copy upper/lower field from cur */
copy_picture_field(s, s->cur, out, inlink, tff ? FIELD_UPPER : FIELD_LOWER, s->lowpass); copy_picture_field(s, s->cur, out, inlink, tff ? FIELD_UPPER : FIELD_LOWER, s->lowpass);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment