From 48ecb3e717979195d45c691366da422fb7b06f90 Mon Sep 17 00:00:00 2001 From: rfelker Date: Mon, 18 Aug 2003 14:49:06 +0000 Subject: clean up field flags: 1) cosmetic change, no reason these need to be mpeg2-specific 2) add a flag to tell when fields are ordered, so we don't have to assume bff (which would usually be wrong) when field flags are not available. 3) add other flags for future use :) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10664 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vf_softpulldown.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'libmpcodecs/vf_softpulldown.c') diff --git a/libmpcodecs/vf_softpulldown.c b/libmpcodecs/vf_softpulldown.c index 909a22bc50..67811a1362 100644 --- a/libmpcodecs/vf_softpulldown.c +++ b/libmpcodecs/vf_softpulldown.c @@ -37,7 +37,7 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi) { mp_image_t *dmpi; int ret = 0; - int flags = mpi->mpeg2_flags; + int flags = mpi->fields; int state = vf->priv->state; dmpi = vf_get_image(vf->next, mpi->imgfmt, @@ -47,19 +47,21 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi) vf->priv->in++; if ((state == 0 && - !(flags & MP_IMGMPEG2FLAG_TOP_FIELD_FIRST)) || + !(flags & MP_IMGFIELD_TOP_FIRST)) || (state == 1 && - flags & MP_IMGMPEG2FLAG_TOP_FIELD_FIRST)) + flags & MP_IMGFIELD_TOP_FIRST)) { mp_msg(MSGT_VFILTER, MSGL_WARN, - "softpulldown: Unexpected mpeg2 flags: state=%d top_field_first=%d repeat_first_field=%d\n", + "softpulldown: Unexpected field flags: state=%d top_field_first=%d repeat_first_field=%d\n", state, - (flags & MP_IMGMPEG2FLAG_TOP_FIELD_FIRST) == 1, - (flags & MP_IMGMPEG2FLAG_REPEAT_FIRST_FIELD) == 1); + (flags & MP_IMGFIELD_TOP_FIRST) != 0, + (flags & MP_IMGFIELD_REPEAT_FIRST) != 0); + state ^= 1; + } if (state == 0) { ret = vf_next_put_image(vf, mpi); vf->priv->out++; - if (flags & MP_IMGMPEG2FLAG_REPEAT_FIRST_FIELD) { + if (flags & MP_IMGFIELD_REPEAT_FIRST) { my_memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h/2, dmpi->stride[0]*2, mpi->stride[0]*2); @@ -95,7 +97,7 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi) } ret = vf_next_put_image(vf, dmpi); vf->priv->out++; - if (flags & MP_IMGMPEG2FLAG_REPEAT_FIRST_FIELD) { + if (flags & MP_IMGFIELD_REPEAT_FIRST) { ret |= vf_next_put_image(vf, mpi); vf->priv->out++; state=0; -- cgit v1.2.3