]> git.sesse.net Git - vlc/commitdiff
Qt: hasInput() now checks for EOF of input
authorJean-Baptiste Kempf <jb@videolan.org>
Thu, 25 Dec 2008 17:36:23 +0000 (18:36 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 30 Dec 2008 12:19:33 +0000 (13:19 +0100)
Are vlc_object_alive( p_input ) and !p_input->b_dead redundant?

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/gui/qt4/input_manager.hpp

index 711401e4347a4105b1cb483b28eb4a49500f03a3..0c8e9f8a27bf045f790c09a59bce707ecc257f07 100644 (file)
@@ -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; }