aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2019-10-23 13:07:19 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2019-10-23 13:07:19 +0200
commit1feaeef7061561cbde9693fec3cd4c5e6d01bb6f (patch)
tree3aa3101699e0c2d8456d35a70346ad32e68b998b
parent756c6db1ccd426f6ab61eee4f5839bb089ac6fab (diff)
cec-follower: fix index handling
node->state.service_idx is now set at the end of analog_update_tuner_dev_info(), so use idx for the index calculations. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/cec-follower/cec-tuner.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/utils/cec-follower/cec-tuner.cpp b/utils/cec-follower/cec-tuner.cpp
index 9dc49224..bf33c440 100644
--- a/utils/cec-follower/cec-tuner.cpp
+++ b/utils/cec-follower/cec-tuner.cpp
@@ -447,11 +447,10 @@ static void analog_update_tuner_dev_info(struct node *node, unsigned int idx,
info->tuner_display_info = CEC_OP_TUNER_DISPLAY_INFO_ANALOGUE;
info->is_analog = true;
- info->analog.ana_bcast_type = (node->state.service_idx - TOT_DIGITAL_CHANS) / sys_freqs;
+ info->analog.ana_bcast_type = (idx - TOT_DIGITAL_CHANS) / sys_freqs;
info->analog.bcast_system =
- (node->state.service_idx -
- (sys_freqs * info->analog.ana_bcast_type + TOT_DIGITAL_CHANS)) / NUM_ANALOG_FREQS;
- offset = node->state.service_idx % NUM_ANALOG_FREQS;
+ (idx - (sys_freqs * info->analog.ana_bcast_type + TOT_DIGITAL_CHANS)) / NUM_ANALOG_FREQS;
+ offset = idx % NUM_ANALOG_FREQS;
freq_khz = analog_freqs_khz[info->analog.ana_bcast_type][info->analog.bcast_system][offset];
info->analog.ana_freq = (freq_khz * 10) / 625;
if (node->state.service_idx != idx && node->state.tuner_report_changes) {

Privacy Policy