]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
tsdemux: log all PCR changes
authorJaroslav Kysela <perex@perex.cz>
Mon, 1 May 2017 16:19:51 +0000 (18:19 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 1 May 2017 16:19:51 +0000 (18:19 +0200)
src/input/mpegts/tsdemux.c

index 570144fce2b860b25ad6dcb321327da0b1b7f31f..5333dd1c140003690e5edcdeaafc86120380600a 100644 (file)
@@ -105,13 +105,15 @@ ts_recv_packet0
         /* handle the broken info using candidate variable */
         if (t->s_current_pcr == PTS_UNSET || pts_diff(t->s_current_pcr, pcr) <= 90000 ||
             (t->s_candidate_pcr != PTS_UNSET && pts_diff(t->s_candidate_pcr, pcr) <= 90000)) {
-          if (t->s_current_pcr == PTS_UNSET)
-            tvhtrace(LS_TS, "%s: Initial PCR: %"PRId64, service_nicename((service_t*)t), pcr);
-          t->s_current_pcr = pcr;
-          if (t->s_candidate_pcr != PTS_UNSET) {
-            tvhtrace(LS_TS, "%s: PCR change: %"PRId64, service_nicename((service_t*)t), pcr);
-            t->s_candidate_pcr = PTS_UNSET;
+          if (pcr != t->s_current_pcr) {
+            if (t->s_current_pcr == PTS_UNSET)
+              tvhtrace(LS_TS, "%s: PCR initial: %"PRId64, service_nicename((service_t*)t), pcr);
+            else
+              tvhtrace(LS_TS, "%s: PCR change : %"PRId64"%s", service_nicename((service_t*)t), pcr,
+                                                t->s_candidate_pcr != PTS_UNSET ? " (candidate)" : "");
+            t->s_current_pcr = pcr;
           }
+          t->s_candidate_pcr = PTS_UNSET;
         } else {
           t->s_candidate_pcr = pcr;
         }