qv4l2: fix incorrect call to s_fmt when disabling width/height
authorHans Verkuil <hans.verkuil@cisco.com>
Mon, 3 Mar 2014 09:44:57 +0000 (10:44 +0100)
committerHans Verkuil <hans.verkuil@cisco.com>
Mon, 3 Mar 2014 09:44:57 +0000 (10:44 +0100)
When the frame width and height fields are disabled because we start
streaming, the editingFinished event is triggered as well, which
causes an attempt to change the format. This causes EBUSY warnings
because it really isn't allowed to do that anymore. Check if the
field is really enabled before we change the format, thus squashing
the warnings.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
utils/qv4l2/general-tab.cpp

index 7cdb217..69242c2 100644 (file)
@@ -892,6 +892,8 @@ void GeneralTab::frameWidthChanged()
        v4l2_format fmt;
        int val = m_frameWidth->value();
 
+       if (!m_frameWidth->isEnabled())
+               return;
        g_fmt_cap(fmt);
        fmt.fmt.pix.width = val;
        if (try_fmt(fmt))
@@ -905,6 +907,8 @@ void GeneralTab::frameHeightChanged()
        v4l2_format fmt;
        int val = m_frameHeight->value();
 
+       if (!m_frameHeight->isEnabled())
+               return;
        g_fmt_cap(fmt);
        fmt.fmt.pix.height = val;
        if (try_fmt(fmt))