]> git.sesse.net Git - vlc/commitdiff
input_clock_ConvertTS: log failures
authorRafaël Carré <funman@videolan.org>
Sat, 15 Feb 2014 14:17:37 +0000 (15:17 +0100)
committerRafaël Carré <funman@videolan.org>
Sat, 15 Feb 2014 14:52:17 +0000 (15:52 +0100)
src/input/clock.c
src/input/decoder.c

index e5d1697c582fd288f7a37be57f207617eec8769e..1419f8f8131c018468ed2344d985a0aaa1a1aa52 100644 (file)
@@ -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;
 }
index 3028b4325255cf85dc80ffdbd1ad8146268f5119..da889a697dec475d8243ebde17978ef31befadd2 100644 (file)
@@ -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
     {