* Copyright (C) 2002-2009 the VideoLAN team
*
* Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
- * Jan Paul Dinger <jpd@m2x.nl>
+ * JP Dinger <jpd@m2x.nl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
OBJECT_TO_NPVARIANT(NPN_RetainObject(videoObj), result);
return INVOKERESULT_NO_ERROR;
case ID_root_VersionInfo:
- {
- const char *s = libvlc_get_version();
- int len = strlen(s);
- NPUTF8 *retval =(NPUTF8*)NPN_MemAlloc(len);
- if( !retval )
- return INVOKERESULT_OUT_OF_MEMORY;
-
- memcpy(retval, s, len);
- STRINGN_TO_NPVARIANT(retval, len, result);
- return INVOKERESULT_NO_ERROR;
- }
+ return invokeResultString(libvlc_get_version(),result);
default:
;
}
switch( index )
{
case ID_root_versionInfo:
- if( argCount == 0 )
- {
- const char *s = libvlc_get_version();
- int len = strlen(s);
- NPUTF8 *retval =(NPUTF8*)NPN_MemAlloc(len);
- if( !retval )
- return INVOKERESULT_OUT_OF_MEMORY;
- memcpy(retval, s, len);
- STRINGN_TO_NPVARIANT(retval, len, result);
- return INVOKERESULT_NO_ERROR;
- }
- return INVOKERESULT_NO_SUCH_METHOD;
+ if( 0 != argCount )
+ return INVOKERESULT_NO_SUCH_METHOD;
+ return invokeResultString(libvlc_get_version(),result);
default:
;
}
LibvlcPlaylistNPObject::~LibvlcPlaylistNPObject()
{
- if( isValid() )
- {
- if( playlistItemsObj ) NPN_ReleaseObject(playlistItemsObj);
- }
+ // Why the isValid()?
+ if( isValid() && playlistItemsObj )
+ NPN_ReleaseObject(playlistItemsObj);
};
const NPUTF8 * const LibvlcPlaylistNPObject::propertyNames[] =
}
}
- int item = p_plugin->playlist_add_extended_untrusted(url, name, i_options,
- const_cast<const char **>(ppsz_options), &ex);
+ int item = p_plugin->playlist_add_extended_untrusted(url, name,
+ i_options, const_cast<const char **>(ppsz_options), &ex);
free(url);
free(name);
for( int i=0; i< i_options; ++i )