[vlc-devel] commit: Mozilla: Fix regression introduced in [771ba] ( Rafaël Carré )

git version control git at videolan.org
Thu Aug 7 15:59:44 CEST 2008


vlc | branch: 0.8.6-bugfix | Rafaël Carré <rcarre at m2x.nl> | Thu Aug  7 15:53:51 2008 +0200| [0ef52797d4e00fd3f11c58bbbe9fd4bcb3080619] | committer: Rafaël Carré 

Mozilla: Fix regression introduced in [771ba]

When the input object is still accessible, but its variables have been
destroyed, fake libvlc_input_get_state() returning 0 when an exception
has been raised.

Value 0 (INIT_S in enum input_state_e) is used in javascript to know
when an input has stopped.

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

 mozilla/control/npolibvlc.cpp |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/mozilla/control/npolibvlc.cpp b/mozilla/control/npolibvlc.cpp
index 9dfd5cb..c2b891f 100755
--- a/mozilla/control/npolibvlc.cpp
+++ b/mozilla/control/npolibvlc.cpp
@@ -434,9 +434,10 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::getProperty(int index, NPVari
             libvlc_input_free(p_input);
             if( libvlc_exception_raised(&ex) )
             {
-                NPN_SetException(this, libvlc_exception_get_message(&ex));
+                /* for input state, return CLOSED rather than an exception */
+                INT32_TO_NPVARIANT(0, result);
                 libvlc_exception_clear(&ex);
-                return INVOKERESULT_GENERIC_ERROR;
+                return INVOKERESULT_NO_ERROR;
             }
             INT32_TO_NPVARIANT(val, result);
             return INVOKERESULT_NO_ERROR;




More information about the vlc-devel mailing list