This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:

Subject: cec-follower: fix bugs for tuner emulation
Author:  Jiunn Chang <c0d1n61...@gmail.com>
Date:    Mon Sep 30 22:18:21 2019 -0500

Fix bugs for tuner emulation:
  - analog_tuner_init() needs to store ana_freq as multiples of 62.5 kHz
  - analog_set_tuner_dev_info() needs to check the broadcast type and
    broadcast system are valid before getting the nearest frequency

Signed-off-by: Jiunn Chang <c0d1n61...@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl>

 utils/cec-follower/cec-tuner.cpp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=9bc2ad62d9b3b21be2aa58dbe8a3db34439228f4
diff --git a/utils/cec-follower/cec-tuner.cpp b/utils/cec-follower/cec-tuner.cpp
index acc3fd00c671..d74981b2ee12 100644
--- a/utils/cec-follower/cec-tuner.cpp
+++ b/utils/cec-follower/cec-tuner.cpp
@@ -92,13 +92,15 @@ static unsigned int 
analog_freqs_khz[3][9][NUM_ANALOG_FREQS] =
 
 void analog_tuner_init(struct cec_op_tuner_device_info *info)
 {
+       unsigned int freq_khz;
+
        info->rec_flag = CEC_OP_REC_FLAG_NOT_USED;
        info->tuner_display_info = CEC_OP_TUNER_DISPLAY_INFO_ANALOGUE;
        info->is_analog = true;
        info->analog.ana_bcast_type = CEC_OP_ANA_BCAST_TYPE_CABLE;
        info->analog.bcast_system = CEC_OP_BCAST_SYSTEM_PAL_BG;
-       info->analog.ana_freq =
-               
analog_freqs_khz[info->analog.ana_bcast_type][info->analog.bcast_system][0];
+       freq_khz = 
analog_freqs_khz[info->analog.ana_bcast_type][info->analog.bcast_system][0];
+       info->analog.ana_freq = (freq_khz * 10) / 625;
 }
 
 static unsigned int analog_get_nearest_freq(__u8 ana_bcast_type, __u8 
ana_bcast_system,
@@ -123,7 +125,7 @@ static bool analog_set_tuner_dev_info(struct node *node, 
struct cec_msg *msg)
        __u8 system;
 
        cec_ops_select_analogue_service(msg, &type, &freq, &system);
-       if (info->analog.ana_bcast_type < 3 && info->analog.bcast_system < 9) {
+       if (type < 3 && system < 9) {
                int freq_khz = (freq * 625) / 10;
                unsigned int nearest = analog_get_nearest_freq(type, system,
                                                               freq_khz);

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to