]> git.sesse.net Git - vlc/commitdiff
Prevent negative caching value to be displayed.
authorLaurent Aimar <fenrir@videolan.org>
Tue, 23 Mar 2010 21:38:50 +0000 (22:38 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Tue, 23 Mar 2010 21:38:50 +0000 (22:38 +0100)
src/input/es_out.c

index 7c62573affa0c4c1b819a2a7dd8a4149a1f5e003..bbcbcd7222b279ff26b19a53ccf91bd7f4826b66 100644 (file)
@@ -648,7 +648,7 @@ static void EsOutDecodersStopBuffering( es_out_t *out, bool b_forced )
 
     if( i_stream_duration <= i_buffering_duration && !b_forced )
     {
-        const double f_level = (double)i_stream_duration / i_buffering_duration;
+        const double f_level = __MAX( (double)i_stream_duration / i_buffering_duration, 0 );
         input_SendEventCache( p_sys->p_input, f_level );
 
         msg_Dbg( p_sys->p_input, "Buffering %d%%", (int)(100 * f_level) );