summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-01-14 02:51:24 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-01-14 03:42:05 +0200
commit38a76f7fdf5c03bc49072b693d7c53b343f2994a (patch)
tree0e8c7e419f8bbfe9ad55beba0fd17b3de94fb386 /libmpcodecs
parent1f782eb802e9774bc53103e935eb673c283cf0aa (diff)
downloadmpv-38a76f7fdf5c03bc49072b693d7c53b343f2994a.tar.bz2
mpv-38a76f7fdf5c03bc49072b693d7c53b343f2994a.tar.xz
core: Better -nocorrect-pts pause and filter-added frames handling
Rewrite the -nocorrect-pts frame creation code. The new version always updates the visible frame when seeking while pausing, and supports filter-added frames. It can not time those properly though. Now the handling of filter-added frames in MPlayer always uses the new method independently of the value of correct-pts but MEncoder still expects the old behavior. Add a global variable that is set under MEncoder only and change the filters to choose behavior based on that instead of the correct_pts option.
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vf_tfields.c9
-rw-r--r--libmpcodecs/vf_yadif.c7
2 files changed, 9 insertions, 7 deletions
diff --git a/libmpcodecs/vf_tfields.c b/libmpcodecs/vf_tfields.c
index 0d88119371..347cd4bb9e 100644
--- a/libmpcodecs/vf_tfields.c
+++ b/libmpcodecs/vf_tfields.c
@@ -310,9 +310,10 @@ static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts)
return continue_buffered_image(vf);
}
+extern const int under_mencoder;
+
static int continue_buffered_image(struct vf_instance *vf)
{
- struct MPOpts *opts = vf->opts;
int i=vf->priv->buffered_i;
double pts = vf->priv->buffered_pts;
mp_image_t *mpi = vf->priv->buffered_mpi;
@@ -363,7 +364,7 @@ static int continue_buffered_image(struct vf_instance *vf)
dmpi->stride[2] = 2*mpi->stride[2];
}
ret |= vf_next_put_image(vf, dmpi, pts);
- if (opts->correct_pts)
+ if (!under_mencoder)
break;
else
if (!i) vf_next_control(vf, VFCTRL_FLIP_PAGE, NULL);
@@ -393,7 +394,7 @@ static int continue_buffered_image(struct vf_instance *vf)
mpi->chroma_width, mpi->chroma_height, (i^!tff));
}
ret |= vf_next_put_image(vf, dmpi, pts);
- if (opts->correct_pts)
+ if (!under_mencoder)
break;
else
if (!i) vf_next_control(vf, VFCTRL_FLIP_PAGE, NULL);
@@ -419,7 +420,7 @@ static int continue_buffered_image(struct vf_instance *vf)
dmpi->stride[2], mpi->stride[2]*2, (i^!tff));
}
ret |= vf_next_put_image(vf, dmpi, pts);
- if (opts->correct_pts)
+ if (!under_mencoder)
break;
else
if (!i) vf_next_control(vf, VFCTRL_FLIP_PAGE, NULL);
diff --git a/libmpcodecs/vf_yadif.c b/libmpcodecs/vf_yadif.c
index fd46f241cd..2c80a2ec5b 100644
--- a/libmpcodecs/vf_yadif.c
+++ b/libmpcodecs/vf_yadif.c
@@ -416,9 +416,10 @@ static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){
return continue_buffered_image(vf);
}
+extern const int under_mencoder;
+
static int continue_buffered_image(struct vf_instance *vf)
{
- struct MPOpts *opts = vf->opts;
mp_image_t *mpi = vf->priv->buffered_mpi;
int tff = vf->priv->buffered_tff;
double pts = vf->priv->buffered_pts;
@@ -435,10 +436,10 @@ static int continue_buffered_image(struct vf_instance *vf)
mpi->width,mpi->height);
vf_clone_mpi_attributes(dmpi, mpi);
filter(vf->priv, dmpi->planes, dmpi->stride, mpi->w, mpi->h, i ^ tff ^ 1, tff);
- if (opts->correct_pts && i < (vf->priv->mode & 1))
+ if (i < (vf->priv->mode & 1) && !under_mencoder)
vf_queue_frame(vf, continue_buffered_image);
ret |= vf_next_put_image(vf, dmpi, pts /*FIXME*/);
- if (opts->correct_pts)
+ if (!under_mencoder)
break;
if(i<(vf->priv->mode&1))
vf_next_control(vf, VFCTRL_FLIP_PAGE, NULL);