summaryrefslogtreecommitdiffstats
path: root/video/filter/vf_vdpaupp.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-05-04 10:54:31 +0200
committerwm4 <wm4@nowhere>2014-05-04 11:03:21 +0200
commitf5a564d417fd5af9fe282171cbab44516f10c8c3 (patch)
treec7a12f27bb3f52b91656d5bfe3c9a3ed161b3038 /video/filter/vf_vdpaupp.c
parenta7fe47e49521009e2790e28c286ef199dae0b4f5 (diff)
downloadmpv-f5a564d417fd5af9fe282171cbab44516f10c8c3.tar.bz2
mpv-f5a564d417fd5af9fe282171cbab44516f10c8c3.tar.xz
vf_vdpaupp: make code clarity improvements
This shouldn't change anything functionally, except that it buffers 1 frame less in the first-field deinterlacing mode.
Diffstat (limited to 'video/filter/vf_vdpaupp.c')
-rw-r--r--video/filter/vf_vdpaupp.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/video/filter/vf_vdpaupp.c b/video/filter/vf_vdpaupp.c
index 1177dc74cf..5fede55786 100644
--- a/video/filter/vf_vdpaupp.c
+++ b/video/filter/vf_vdpaupp.c
@@ -121,7 +121,7 @@ static bool output_field(struct vf_instance *vf, int pos)
static int filter_ext(struct vf_instance *vf, struct mp_image *mpi)
{
struct vf_priv_s *p = vf->priv;
- int maxbuffer = p->opts.deint ? MP_ARRAY_SIZE(p->buffered) : 2;
+ int maxbuffer = p->opts.deint >= 2 ? 3 : 2;
bool eof = !mpi;
if (mpi) {
@@ -131,7 +131,7 @@ static int filter_ext(struct vf_instance *vf, struct mp_image *mpi)
return -1;
mpi = new;
- if (mpi->planes[2]) {
+ if (mp_vdpau_mixed_frame_get(mpi)) {
MP_ERR(vf, "Can't apply vdpaupp filter multiple times.\n");
vf_add_output_frame(vf, mpi);
return -1;
@@ -150,14 +150,14 @@ static int filter_ext(struct vf_instance *vf, struct mp_image *mpi)
while (1) {
int current = p->prev_pos - 1;
- if (current < 0)
- break;
- // Wait for enough future frames being buffered.
- // (Past frames should be around if available at all.)
- if (p->opts.deint && !eof && !FIELD_VALID(p, current - 1))
+ if (!FIELD_VALID(p, current))
break;
// No field-splitting deinterlace -> only output first field (odd index)
- if (p->opts.deint >= 2 || (current & 1)) {
+ if ((current & 1) || p->opts.deint >= 2) {
+ // Wait for enough future frames being buffered.
+ // (Past frames are always around if available at all.)
+ if (!eof && !FIELD_VALID(p, current - 1))
+ break;
if (!output_field(vf, current))
break;
}