summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vf_tfields.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmpcodecs/vf_tfields.c')
-rw-r--r--libmpcodecs/vf_tfields.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/libmpcodecs/vf_tfields.c b/libmpcodecs/vf_tfields.c
index ff4dd62434..ee50d4f6ca 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"
@@ -326,7 +327,6 @@ static void (*qpel_li)(unsigned char *d, unsigned char *s, int w, int h, int ds,
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 put_image(struct vf_instance *vf, mp_image_t *mpi, double 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;
}