]> git.sesse.net Git - vlc/blobdiff - projects/mozilla/vlcplugin.cpp
Remove deadcode.
[vlc] / projects / mozilla / vlcplugin.cpp
index 7a4e05b3002087fa2e58510aefacf914cb93fe06..65d090aa3df7f18299559d65a1f3ff86f6cac214 100644 (file)
@@ -32,7 +32,6 @@
 #endif
 
 #include "vlcplugin.h"
-#include "control/npovlc.h"
 #include "control/npolibvlc.h"
 
 #include <ctype.h>
@@ -109,6 +108,7 @@ NPError VlcPlugin::init(int argc, char* const argn[], char* const argv[])
     ppsz_argv[ppsz_argc++] = "-vv";
     ppsz_argv[ppsz_argc++] = "--no-stats";
     ppsz_argv[ppsz_argc++] = "--no-media-library";
+    ppsz_argv[ppsz_argc++] = "--ignore-config";
     ppsz_argv[ppsz_argc++] = "--intf";
     ppsz_argv[ppsz_argc++] = "dummy";
 
@@ -173,10 +173,13 @@ NPError VlcPlugin::init(int argc, char* const argn[], char* const argv[])
     }
 
 
+    libvlc_exception_t ex;
+    libvlc_exception_init(&ex);
 
-    libvlc_instance = libvlc_new(ppsz_argc, ppsz_argv, NULL);
-    if( ! libvlc_instance )
+    libvlc_instance = libvlc_new(ppsz_argc, ppsz_argv, &ex);
+    if( libvlc_exception_raised(&ex) )
     {
+        libvlc_exception_clear(&ex);
         return NPERR_GENERIC_ERROR;
     }
 
@@ -225,53 +228,12 @@ NPError VlcPlugin::init(int argc, char* const argn[], char* const argv[])
     }
 
     /* assign plugin script root class */
-    if( (NULL != progid) && (!strcmp(progid, "VideoLAN.VLCPlugin.2")) )
-    {
-        /* new APIs */
-        p_scriptClass = RuntimeNPClass<LibvlcRootNPObject>::getClass();
-    }
-    else
-    {
-        /* legacy APIs */
-        p_scriptClass = RuntimeNPClass<VlcNPObject>::getClass();
-    }
+    /* new APIs */
+    p_scriptClass = RuntimeNPClass<LibvlcRootNPObject>::getClass();
 
     return NPERR_NO_ERROR;
 }
 
-#if 0
-#ifdef XP_WIN
-/* This is really ugly but there is a deadlock when stopping a stream
- * (in VLC_CleanUp()) because the video output is a child of the drawable but
- * is in a different thread. */
-static void HackStopVout( VlcPlugin* p_plugin )
-{
-    MSG msg;
-    HWND hwnd;
-    vlc_value_t value;
-
-    int i_vlc = libvlc_get_vlc_id(p_plugin->libvlc_instance);
-    VLC_VariableGet( i_vlc, "drawable", &value );
-
-    hwnd = FindWindowEx( (HWND)value.i_int, 0, 0, 0 );
-    if( !hwnd ) return;
-
-    PostMessage( hwnd, WM_CLOSE, 0, 0 );
-
-    do
-    {
-        while( PeekMessage( &msg, (HWND)value.i_int, 0, 0, PM_REMOVE ) )
-        {
-            TranslateMessage(&msg);
-            DispatchMessage(&msg);
-        }
-        if( FindWindowEx( (HWND)value.i_int, 0, 0, 0 ) ) Sleep( 10 );
-    }
-    while( (hwnd = FindWindowEx( (HWND)value.i_int, 0, 0, 0 )) );
-}
-#endif /* XP_WIN */
-#endif
-
 VlcPlugin::~VlcPlugin()
 {
     delete psz_baseURL;