diff options
Diffstat (limited to 'libmpcodecs/vf_tfields.c')
-rw-r--r-- | libmpcodecs/vf_tfields.c | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/libmpcodecs/vf_tfields.c b/libmpcodecs/vf_tfields.c index ff4dd62434..415977bddc 100644 --- a/libmpcodecs/vf_tfields.c +++ b/libmpcodecs/vf_tfields.c @@ -21,6 +21,7 @@ #include <string.h> #include "config.h" +#include "options.h" #include "mp_msg.h" #include "cpudetect.h" @@ -325,10 +326,9 @@ static void qpel_4tap_C(unsigned char *d, unsigned char *s, int w, int h, int ds static void (*qpel_li)(unsigned char *d, unsigned char *s, int w, int h, int ds, int ss, int up); static void (*qpel_4tap)(unsigned char *d, unsigned char *s, int w, int h, int ds, int ss, int up); -static int continue_buffered_image(struct vf_instance *vf); -extern int correct_pts; +static int continue_buffered_image(struct vf_instance *); -static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts) +static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts) { vf->priv->buffered_mpi = mpi; vf->priv->buffered_pts = pts; @@ -336,11 +336,7 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts) return continue_buffered_image(vf); } -static double calc_pts(double base_pts, int field) -{ - // FIXME this assumes 25 fps / 50 fields per second - return base_pts + 0.02 * field; -} +extern const int under_mencoder; static int continue_buffered_image(struct vf_instance *vf) { @@ -355,6 +351,7 @@ static int continue_buffered_image(struct vf_instance *vf) if (i == 0) vf_queue_frame(vf, continue_buffered_image); + pts += i * .02; // XXX not right if (!(mpi->flags & MP_IMGFLAG_PLANAR)) bpp = mpi->bpp/8; if (vf->priv->parity < 0) { @@ -392,11 +389,9 @@ static int continue_buffered_image(struct vf_instance *vf) dmpi->stride[1] = 2*mpi->stride[1]; dmpi->stride[2] = 2*mpi->stride[2]; } - ret |= vf_next_put_image(vf, dmpi, calc_pts(pts, i)); - if (correct_pts) + ret |= vf_next_put_image(vf, dmpi, pts); + if (!under_mencoder) break; - else - if (!i) vf_extra_flip(vf); } break; case 1: @@ -422,11 +417,9 @@ static int continue_buffered_image(struct vf_instance *vf) deint(dmpi->planes[2], dmpi->stride[2], mpi->planes[2], mpi->stride[2], mpi->chroma_width, mpi->chroma_height, (i^!tff)); } - ret |= vf_next_put_image(vf, dmpi, calc_pts(pts, i)); - if (correct_pts) + ret |= vf_next_put_image(vf, dmpi, pts); + if (!under_mencoder) break; - else - if (!i) vf_extra_flip(vf); } break; case 2: @@ -448,11 +441,9 @@ static int continue_buffered_image(struct vf_instance *vf) mpi->chroma_width, mpi->chroma_height/2, dmpi->stride[2], mpi->stride[2]*2, (i^!tff)); } - ret |= vf_next_put_image(vf, dmpi, calc_pts(pts, i)); - if (correct_pts) + ret |= vf_next_put_image(vf, dmpi, pts); + if (!under_mencoder) break; - else - if (!i) vf_extra_flip(vf); } break; } @@ -460,7 +451,7 @@ static int continue_buffered_image(struct vf_instance *vf) return ret; } -static int query_format(struct vf_instance *vf, unsigned int fmt) +static int query_format(struct vf_instance* vf, unsigned int fmt) { /* FIXME - figure out which formats exactly work */ switch (fmt) { @@ -475,7 +466,7 @@ static int query_format(struct vf_instance *vf, unsigned int fmt) return 0; } -static int config(struct vf_instance *vf, +static int config(struct vf_instance* vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt) { @@ -491,7 +482,7 @@ static int config(struct vf_instance *vf, return 0; } -static void uninit(struct vf_instance *vf) +static void uninit(struct vf_instance* vf) { free(vf->priv); } |