[vlc-devel] commit: mozilla plugin: cosmetics. (JP Dinger )

git version control git at videolan.org
Sat May 30 22:36:17 CEST 2009


vlc | branch: master | JP Dinger <jpd at videolan.org> | Sat May 30 22:34:46 2009 +0200| [745dbe97f637578d4d51bb14003addc6ad2fab38] | committer: JP Dinger 

mozilla plugin: cosmetics.

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

 projects/mozilla/control/npolibvlc.cpp |   29 +++++++++++------------------
 1 files changed, 11 insertions(+), 18 deletions(-)

diff --git a/projects/mozilla/control/npolibvlc.cpp b/projects/mozilla/control/npolibvlc.cpp
index 5f49b24..31e0e1e 100644
--- a/projects/mozilla/control/npolibvlc.cpp
+++ b/projects/mozilla/control/npolibvlc.cpp
@@ -799,27 +799,20 @@ LibvlcPlaylistNPObject::invoke(int index, const NPVariant *args,
             {
                 if( (argCount < 1) || (argCount > 3) )
                     return INVOKERESULT_NO_SUCH_METHOD;
-
-                char *url = NULL;
+                if( !NPVARIANT_IS_STRING(args[0]) )
+                    return INVOKERESULT_NO_SUCH_METHOD;
 
                 // grab URL
-                if( NPVARIANT_IS_STRING(args[0]) )
-                {
-                    char *s = stringValue(NPVARIANT_TO_STRING(args[0]));
-                    if( s )
-                    {
-                        url = p_plugin->getAbsoluteURL(s);
-                        if( url )
-                            free(s);
-                        else
-                            // problem with combining url, use argument
-                            url = s;
-                    }
-                    else
-                        return INVOKERESULT_OUT_OF_MEMORY;
-                }
+                char *s = stringValue(NPVARIANT_TO_STRING(args[0]));
+                if( !s )
+                    return INVOKERESULT_OUT_OF_MEMORY;
+
+                char *url = p_plugin->getAbsoluteURL(s);
+                if( url )
+                    free(s);
                 else
-                    return INVOKERESULT_NO_SUCH_METHOD;
+                    // problem with combining url, use argument
+                    url = s;
 
                 char *name = NULL;
 




More information about the vlc-devel mailing list