[vlc-commits] commit: Prevent negative caching value to be displayed. (Laurent Aimar )

git at videolan.org git at videolan.org
Tue Mar 23 22:39:36 CET 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Tue Mar 23 22:38:50 2010 +0100| [ff94c5af91a60be2054236c12cc470415f4691ea] | committer: Laurent Aimar 

Prevent negative caching value to be displayed.

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

 src/input/es_out.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/input/es_out.c b/src/input/es_out.c
index 7c62573..bbcbcd7 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -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) );



More information about the vlc-commits mailing list