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-ctl: fix timestamp log for HPD/5V changes
Author:  Hans Verkuil <[email protected]>
Date:    Thu Mar 3 09:37:30 2022 +0100

The timestamp format for HPD and 5V changes was slightly different
compared to CEC changes. Make them consistent to improve readability
of the logs.

Signed-off-by: Hans Verkuil <[email protected]>

 utils/cec-ctl/cec-ctl.cpp | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=467102b5f285d16c5facefb924f63c11de88569a
diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp
index 2866fc8ab97c..202078425e74 100644
--- a/utils/cec-ctl/cec-ctl.cpp
+++ b/utils/cec-ctl/cec-ctl.cpp
@@ -471,19 +471,26 @@ static void log_event(struct cec_event &ev, bool show)
 {
        bool is_high = ev.event == CEC_EVENT_PIN_CEC_HIGH;
        bool is_initial = ev.flags & CEC_EVENT_FL_INITIAL_STATE;
+       bool is_pin_event = false;
        __u16 pa;
 
        if (ev.event != CEC_EVENT_PIN_CEC_LOW && ev.event != 
CEC_EVENT_PIN_CEC_HIGH &&
            ev.event != CEC_EVENT_PIN_HPD_LOW && ev.event != 
CEC_EVENT_PIN_HPD_HIGH &&
            ev.event != CEC_EVENT_PIN_5V_LOW && ev.event != 
CEC_EVENT_PIN_5V_HIGH)
                printf("\n");
+       else
+               is_pin_event = true;
        if ((ev.flags & CEC_EVENT_FL_DROPPED_EVENTS) && show)
                printf("(warn: %s events were lost)\n", event2s(ev.event));
        if (show) {
-               if (is_initial)
+               if (is_initial) {
                        printf("Initial ");
-               else if (ev.event != CEC_EVENT_PIN_CEC_LOW && ev.event != 
CEC_EVENT_PIN_CEC_HIGH)
-                       printf("%s: ", ts2s(ev.ts).c_str());
+               } else if (ev.event != CEC_EVENT_PIN_CEC_LOW && ev.event != 
CEC_EVENT_PIN_CEC_HIGH) {
+                       if (is_pin_event)
+                               printf("%s: ", ts2s(ev.ts / 
1000000000.0).c_str());
+                       else
+                               printf("%s: ", ts2s(ev.ts).c_str());
+               }
        }
 
        switch (ev.event) {

_______________________________________________
linuxtv-commits mailing list
[email protected]
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to