[vlc-commits] input_clock_ConvertTS: log failures

Rafaël Carré git at videolan.org
Sat Feb 15 16:10:15 CET 2014


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Sat Feb 15 15:17:37 2014 +0100| [630ccbb6f4c8842c534de9c6f9b32c100ab1912b] | committer: Rafaël Carré

input_clock_ConvertTS: log failures

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=630ccbb6f4c8842c534de9c6f9b32c100ab1912b
---

 src/input/clock.c   |   12 +++++++++---
 src/input/decoder.c |    8 ++++++--
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/input/clock.c b/src/input/clock.c
index e5d1697..1419f8f 100644
--- a/src/input/clock.c
+++ b/src/input/clock.c
@@ -446,9 +446,15 @@ int input_clock_ConvertTS( input_clock_t *cl,
     vlc_mutex_unlock( &cl->lock );
 
     /* Check ts validity */
-    if( i_ts_bound != INT64_MAX &&
-        *pi_ts0 > VLC_TS_INVALID && *pi_ts0 >= mdate() + i_ts_delay + i_ts_buffering + i_ts_bound )
-        return VLC_EGENERIC;
+    if (i_ts_bound != INT64_MAX && *pi_ts0 > VLC_TS_INVALID) {
+        if (*pi_ts0 >= mdate() + i_ts_delay + i_ts_buffering + i_ts_bound) {
+            vlc_Log(NULL, VLC_MSG_ERR, "clock",
+                "Timestamp conversion failed (delay %"PRId64", buffering "
+                "%"PRId64", bound %"PRId64")",
+                i_ts_delay, i_ts_buffering, i_ts_bound);
+            return VLC_EGENERIC;
+        }
+    }
 
     return VLC_SUCCESS;
 }
diff --git a/src/input/decoder.c b/src/input/decoder.c
index 3028b43..da889a6 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -666,8 +666,10 @@ static mtime_t DecoderGetDisplayDate( decoder_t *p_dec, mtime_t i_ts )
     if( !p_owner->p_clock || i_ts <= VLC_TS_INVALID )
         return i_ts;
 
-    if( input_clock_ConvertTS( p_owner->p_clock, NULL, &i_ts, NULL, INT64_MAX ) )
+    if( input_clock_ConvertTS( p_owner->p_clock, NULL, &i_ts, NULL, INT64_MAX ) ) {
+        msg_Err(p_dec, "Could not get display date for timestamp %"PRId64"", i_ts);
         return VLC_TS_INVALID;
+    }
 
     return i_ts;
 }
@@ -1062,8 +1064,10 @@ static void DecoderFixTs( decoder_t *p_dec, mtime_t *pi_ts0, mtime_t *pi_ts1,
         *pi_ts0 += i_es_delay;
         if( pi_ts1 && *pi_ts1 > VLC_TS_INVALID )
             *pi_ts1 += i_es_delay;
-        if( input_clock_ConvertTS( p_clock, &i_rate, pi_ts0, pi_ts1, i_ts_bound ) )
+        if( input_clock_ConvertTS( p_clock, &i_rate, pi_ts0, pi_ts1, i_ts_bound ) ) {
+            msg_Err(p_dec, "Could not convert timestamps %"PRId64", %"PRId64"", pi_ts0, pi_ts1);
             *pi_ts0 = VLC_TS_INVALID;
+        }
     }
     else
     {



More information about the vlc-commits mailing list