[vlc-devel] commit: Qt4: tell how much has been buffered when buffering (percents) ( Ilkka Ollakka )

git version control git at videolan.org
Mon Jan 12 19:58:12 CET 2009


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Mon Jan 12 20:57:19 2009 +0200| [d90abb6bae3f95afc53c8138591a687ce8bbf91f] | committer: Ilkka Ollakka 

Qt4: tell how much has been buffered when buffering (percents)

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

 modules/gui/qt4/components/interface_widgets.cpp |    5 ++++-
 modules/gui/qt4/input_manager.cpp                |    6 ++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index ea8d5a6..2e2f278 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -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 + "%" );
 }
 
 
diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index 5102644..70cd5e7 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -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 );
     }




More information about the vlc-devel mailing list