aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-07-21 20:16:39 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2014-07-21 20:16:39 +0200
commit3ff2c9a064767854554b5639459520ac9f6ec3cf (patch)
treec868192913626febe574c50768b680ffbf7fd437
parent0779c5fde5303f43eec1241b2b090cf237725687 (diff)
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 <hans.verkuil@cisco.com>
-rw-r--r--utils/qv4l2/general-tab.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/utils/qv4l2/general-tab.cpp b/utils/qv4l2/general-tab.cpp
index 978eb467..76de7834 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)

Privacy Policy