Hi, Hmm, nasty... On 10/06/2011 01:13 PM, Hans Verkuil wrote: > Hi Hans! > > I've been looking into a problem with libv4l2 that occurs when you change TV > standard or video preset using VIDIOC_S_STD or VIDIOC_S_DV_PRESET. These calls > will change the format implicitly (e.g. if the current format is set for PAL > at 720x576 and you select NTSC, then the format will be reset to 720x480). > > However, libv4l2 isn't taking this into account and will keep using the cached > dest_fmt value. It is easy to reproduce this using qv4l2. > > The same problem is likely to occur with S_CROP (haven't tested that yet, > though): calling S_CROP can also change the format. > > To be precise: S_STD and S_DV_PRESET can change both the crop rectangle and > the format, and S_CROP can change the format. First of all it would be good to actually document this behavior of VIDIOC_S_STD or VIDIOC_S_DV_PRESET, the current docs don't mention this at all: http://linuxtv.org/downloads/v4l-dvb-apis/standard.html I've attached 2 patches which should make libv4l2 deal with this correctly. I assume you've a reproducer for this and I would appreciate it if you could test if these patches actually fix the issue you are seeing. Regards, Hans