comparison libmpdemux/tvi_v4l2.c @ 16186:e861f9b7a70e

take into account that VIDIOC_S_FMT might return updated parameters
author faust3
date Sat, 06 Aug 2005 19:45:55 +0000
parents 973b82bf1187
children 67a685497d21
comparison
equal deleted inserted replaced
16185:973b82bf1187 16186:e861f9b7a70e
588 if (ioctl(priv->video_fd, VIDIOC_S_FMT, &priv->format) < 0) { 588 if (ioctl(priv->video_fd, VIDIOC_S_FMT, &priv->format) < 0) {
589 mp_msg(MSGT_TV, MSGL_ERR, "%s: ioctl set format failed: %s\n", 589 mp_msg(MSGT_TV, MSGL_ERR, "%s: ioctl set format failed: %s\n",
590 info.short_name, strerror(errno)); 590 info.short_name, strerror(errno));
591 return TVI_CONTROL_FALSE; 591 return TVI_CONTROL_FALSE;
592 } 592 }
593 /* according to the v4l2 specs VIDIOC_S_FMT should not fail, inflexible drivers
594 might even always return the default parameters -> update the format here*/
595 priv->mp_format = fcc_vl2mp(priv->format.fmt.pix.pixelformat);
593 return TVI_CONTROL_TRUE; 596 return TVI_CONTROL_TRUE;
594 case TVI_CONTROL_VID_GET_WIDTH: 597 case TVI_CONTROL_VID_GET_WIDTH:
595 if (getfmt(priv) < 0) return TVI_CONTROL_FALSE; 598 if (getfmt(priv) < 0) return TVI_CONTROL_FALSE;
596 *(int *)arg = priv->format.fmt.pix.width; 599 *(int *)arg = priv->format.fmt.pix.width;
597 mp_msg(MSGT_TV, MSGL_V, "%s: get width: %d\n", info.short_name, 600 mp_msg(MSGT_TV, MSGL_V, "%s: get width: %d\n", info.short_name,