[vlc-devel] commit: Qt: hasInput() now checks for EOF of input (Jean-Baptiste Kempf )

git version control git at videolan.org
Tue Dec 30 13:21:08 CET 2008


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Dec 25 18:36:23 2008 +0100| [1caec50b08d4cae58efb7cd76f937e3e780e523b] | committer: Jean-Baptiste Kempf 

Qt: hasInput() now checks for EOF of input

Are vlc_object_alive( p_input ) and !p_input->b_dead redundant?

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/gui/qt4/input_manager.hpp |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt4/input_manager.hpp b/modules/gui/qt4/input_manager.hpp
index 711401e..0c8e9f8 100644
--- a/modules/gui/qt4/input_manager.hpp
+++ b/modules/gui/qt4/input_manager.hpp
@@ -77,8 +77,14 @@ public:
     virtual ~InputManager();
 
     void delInput();
-    bool hasInput() { return p_input && !p_input->b_dead
-                            && vlc_object_alive (p_input); }
+    bool hasInput()
+    {
+        return p_input /* We have an input */
+            && !p_input->b_dead /* not dead yet, */
+            && !p_input->b_eof  /* not EOF either, */
+            && vlc_object_alive (p_input); /* and the VLC object is alive */
+    }
+
     bool hasAudio();
     bool hasVideo() { return hasInput() && b_video; }
 




More information about the vlc-devel mailing list