diff options
author | Rudolf Polzer <divverent@alientrap.org> | 2011-04-23 18:56:47 +0200 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2011-04-24 03:55:47 +0300 |
commit | 994b21a80a2f37b0d672526739cb742b87f33ad9 (patch) | |
tree | 222e014be69723c4772d5045fee35eb98ffc8a63 /libmpcodecs/pullup.c | |
parent | 28b3cc0efe7a575cb8004d1b109ce5ca2f2953bb (diff) | |
download | mpv-994b21a80a2f37b0d672526739cb742b87f33ad9.tar.bz2 mpv-994b21a80a2f37b0d672526739cb742b87f33ad9.tar.xz |
vf_*: fix pts values passed to the next filter
Many video filters failed to calculate or even just pass through pts
values for their output frames. Fix this, and also make the two
remaining filters that called vf_next_put_image() twice for the same
input frame (vf_softpulldown, vf_telecine) use vf_queue_frame() so
that e.g. framestepping properly sees both frames.
Changed filters: vf_bmovl, vf_detc, vf_divtc, vf_filmdint, vf_ivtc,
vf_lavc, vf_phase, vf_pullup, vf_softpulldown, vf_telecine, vf_tile,
vf_tinterlace.
Diffstat (limited to 'libmpcodecs/pullup.c')
-rw-r--r-- | libmpcodecs/pullup.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libmpcodecs/pullup.c b/libmpcodecs/pullup.c index 2675be6146..b70aa9b56f 100644 --- a/libmpcodecs/pullup.c +++ b/libmpcodecs/pullup.c @@ -22,6 +22,7 @@ #include "config.h" #include "pullup.h" #include "cpudetect.h" +#include "mpcommon.h" @@ -412,7 +413,8 @@ static void check_field_queue(struct pullup_context *c) } } -void pullup_submit_field(struct pullup_context *c, struct pullup_buffer *b, int parity) +void pullup_submit_field(struct pullup_context *c, struct pullup_buffer *b, + int parity, double pts) { struct pullup_field *f; @@ -428,6 +430,7 @@ void pullup_submit_field(struct pullup_context *c, struct pullup_buffer *b, int f->flags = 0; f->breaks = 0; f->affinity = 0; + f->pts = pts; compute_metric(c, f, parity, f->prev->prev, parity, c->diff, f->diffs); compute_metric(c, parity?f->prev:f, 0, parity?f:f->prev, 1, c->comb, f->comb); @@ -663,12 +666,19 @@ struct pullup_frame *pullup_get_frame(struct pullup_context *c) fr->length = n; fr->parity = c->first->parity; fr->buffer = 0; + fr->pts = 0; for (i = 0; i < n; i++) { /* We cheat and steal the buffer without release+relock */ fr->ifields[i] = c->first->buffer; c->first->buffer = 0; + if (c->first->pts == MP_NOPTS_VALUE || fr->pts == MP_NOPTS_VALUE) + fr->pts = MP_NOPTS_VALUE; + else + fr->pts += c->first->pts; c->first = c->first->next; } + if (fr->pts != MP_NOPTS_VALUE) + fr->pts /= n; if (n == 1) { fr->ofields[fr->parity] = fr->ifields[0]; |