]> git.sesse.net Git - vlc/commitdiff
Qt4: tell how much has been buffered when buffering (percents)
authorIlkka Ollakka <ileoo@videolan.org>
Mon, 12 Jan 2009 18:57:19 +0000 (20:57 +0200)
committerIlkka Ollakka <ileoo@videolan.org>
Mon, 12 Jan 2009 18:57:55 +0000 (20:57 +0200)
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/input_manager.cpp

index ea8d5a6ee7e2201f37c9cc440500406c62fb0754..2e2f278d96c11112712aa64478131325fdcc7f1c 100644 (file)
@@ -483,7 +483,10 @@ void TimeLabel::toggleTimeDisplay()
 
 void TimeLabel::setCaching( float f_cache )
 {
-    setText( "Buffering" );
+    QString amount;
+    amount.setNum( (int)(100 * f_cache) );
+    msg_Dbg( p_intf, "New caching: %d", (int)(100*f_cache));
+    setText( "Buffering " + amount + "%" );
 }
 
 
index 51026448c5fac8b7a74f561fdc8ca97e3daaac28..70cd5e781499f4ca5b5dd9745a62358655df8a0c 100644 (file)
@@ -524,10 +524,12 @@ void InputManager::UpdateAout()
 }
 void InputManager::UpdateCaching()
 {
-    float f_newCache = var_GetFloat( p_input, "cache" );
+    if(!hasInput()) return;
+
+    float f_newCache = var_GetFloat ( p_input, "cache" );
     if( f_newCache != f_cache )
     {
-        f_newCache = f_cache;
+        f_cache = f_newCache;
         /* Update rate */
         emit cachingChanged( f_cache );
     }