From 3ff2c9a064767854554b5639459520ac9f6ec3cf Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 21 Jul 2014 20:16:39 +0200 Subject: [PATCH] qv4l2: bug fix in re-subscribing source change events The source change event was only subscribed for the first event, not for any of the others. Apparently an 'if-while' construct is legal (?!), but I meant to write 'if () { do {} while() }'. Signed-off-by: Hans Verkuil --- utils/qv4l2/general-tab.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/utils/qv4l2/general-tab.cpp b/utils/qv4l2/general-tab.cpp index 978eb46..76de783 100644 --- a/utils/qv4l2/general-tab.cpp +++ b/utils/qv4l2/general-tab.cpp @@ -280,12 +280,14 @@ void GeneralTab::sourceChangeSubscribe() v4l2_input vin; if (!enum_input(vin, true)) { - struct v4l2_event_subscription sub = { - V4L2_EVENT_SOURCE_CHANGE, vin.index - }; + do { + struct v4l2_event_subscription sub = { + V4L2_EVENT_SOURCE_CHANGE, vin.index + }; - subscribe_event(sub); - } while (!enum_input(vin)); + subscribe_event(sub); + } while (!enum_input(vin)); + } } void GeneralTab::inputSection(bool needsStd, bool needsTimings, v4l2_input vin) -- 2.7.4