X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=projects%2Fmozilla%2Fcontrol%2Fnpolibvlc.cpp;h=73d198e1d2247f72b29064e2141b761b6639e3b9;hb=83b4e8360bcb89dfbd1f773a92fcde9e024a98ac;hp=f9045098a63ae41645245a1ed7f05d771c3d6db6;hpb=f4fef7ff6dff634a315a762f4b1b75abcc432b30;p=vlc diff --git a/projects/mozilla/control/npolibvlc.cpp b/projects/mozilla/control/npolibvlc.cpp index f9045098a6..73d198e1d2 100644 --- a/projects/mozilla/control/npolibvlc.cpp +++ b/projects/mozilla/control/npolibvlc.cpp @@ -42,7 +42,7 @@ #define RETURN_ON_EXCEPTION(this,ex) \ do { if( libvlc_exception_raised(&ex) ) \ { \ - NPN_SetException(this, libvlc_exception_get_message(&ex)); \ + NPN_SetException(this, libvlc_errmsg()); \ libvlc_exception_clear(&ex); \ return INVOKERESULT_GENERIC_ERROR; \ } } while(false) @@ -448,7 +448,7 @@ LibvlcInputNPObject::getProperty(int index, NPVariant &result) { if( index != ID_input_state ) { - NPN_SetException(this, libvlc_exception_get_message(&ex)); + NPN_SetException(this, libvlc_errmsg()); libvlc_exception_clear(&ex); return INVOKERESULT_GENERIC_ERROR; } @@ -588,10 +588,33 @@ LibvlcInputNPObject::setProperty(int index, const NPVariant &value) const NPUTF8 * const LibvlcInputNPObject::methodNames[] = { /* no methods */ + "none", }; - COUNTNAMES(LibvlcInputNPObject,methodCount,methodNames); +enum LibvlcInputNPObjectMethodIds +{ + ID_none, +}; + +RuntimeNPObject::InvokeResult +LibvlcInputNPObject::invoke(int index, const NPVariant *args, + uint32_t argCount, NPVariant &result) +{ + /* is plugin still running */ + if( isPluginRunning() ) + { + switch( index ) + { + case ID_none: + return INVOKERESULT_NO_SUCH_METHOD; + default: + ; + } + } + return INVOKERESULT_GENERIC_ERROR; +} + /* ** implementation of libvlc playlist items object */ @@ -803,6 +826,9 @@ LibvlcPlaylistNPObject::invoke(int index, const NPVariant *args, return INVOKERESULT_NO_SUCH_METHOD; // grab URL + if( NPVARIANT_IS_NULL(args[0]) ) + return INVOKERESULT_NO_SUCH_METHOD; + char *s = stringValue(NPVARIANT_TO_STRING(args[0])); if( !s ) return INVOKERESULT_OUT_OF_MEMORY;