[MPlayer-dev-eng] [PATCH] v4l2: fix "always interlaced" bug NODAEMON

Roberto Ragusa mail at robertoragusa.it
Thu Apr 8 22:58:25 CEST 2004


Hi,
(please CC me, I'm not subscribed)

mencoder always grabs interlaced frames from v4l2, even at 352x288 or less.
I found a subtle bug: we ask V4L2_FIELD_ANY but we set the height to a
default of 480 before setting the correct value (that is 288); the 480
forces V4L2_FIELD_INTERLACED and interlacing remains on, even at 288.

Fix: we reask V4L2_FIELD_ANY when setting the height, so the driver
can decide again about interlacing.

--- /home/rora/mplayer/mplayer/main/libmpdemux/tvi_v4l2.c       2004-02-26 19:42:38.000000000 +0100
+++ tvi_v4l2.c  2004-04-08 22:10:42.760518309 +0200
@@ -575,6 +575,7 @@ static int control(priv_t *priv, int cmd
     case TVI_CONTROL_VID_SET_HEIGHT:
        if (getfmt(priv) < 0) return TVI_CONTROL_FALSE;
        priv->format.fmt.pix.height = *(int *)arg;
+       priv->format.fmt.pix.field = V4L2_FIELD_ANY;
        mp_msg(MSGT_TV, MSGL_V, "%s: set height: %d\n", info.short_name,
               *(int *)arg);
        if (ioctl(priv->video_fd, VIDIOC_S_FMT, &priv->format) < 0) {

-- 
   Roberto Ragusa    mail at robertoragusa.it




More information about the MPlayer-dev-eng mailing list