Commit ed30e5f7 authored by Jean-Paul Saman's avatar Jean-Paul Saman Committed by Rémi Denis-Courmont

Cleanup mozilla plugin

(cherry picked from commit be262960c031fbab9e2600969b08e516f20b6679)

Conflicts:

	projects/mozilla/vlcshell.cpp
parent b5a46dba
...@@ -131,7 +131,7 @@ protected: ...@@ -131,7 +131,7 @@ protected:
bool isPluginRunning() bool isPluginRunning()
{ {
return _instance->pdata; return (_instance->pdata != NULL);
} }
template<class T> T *getPrivate() template<class T> T *getPrivate()
{ {
......
...@@ -221,7 +221,7 @@ NPError VlcPlugin::init(int argc, char* const argn[], char* const argv[]) ...@@ -221,7 +221,7 @@ NPError VlcPlugin::init(int argc, char* const argn[], char* const argv[])
** this URL is used for making absolute URL from relative URL that may be ** this URL is used for making absolute URL from relative URL that may be
** passed as an MRL argument ** passed as an MRL argument
*/ */
NPObject *plugin; NPObject *plugin = NULL;
if( NPERR_NO_ERROR == NPN_GetValue(p_browser, NPNVWindowNPObject, &plugin) ) if( NPERR_NO_ERROR == NPN_GetValue(p_browser, NPNVWindowNPObject, &plugin) )
{ {
...@@ -241,7 +241,7 @@ NPError VlcPlugin::init(int argc, char* const argn[], char* const argv[]) ...@@ -241,7 +241,7 @@ NPError VlcPlugin::init(int argc, char* const argn[], char* const argv[])
{ {
NPString &location = NPVARIANT_TO_STRING(result); NPString &location = NPVARIANT_TO_STRING(result);
psz_baseURL = static_cast<char*>(malloc(location.utf8length+1)); psz_baseURL = (char *) malloc(location.utf8length+1);
if( psz_baseURL ) if( psz_baseURL )
{ {
strncpy(psz_baseURL, location.utf8characters, location.utf8length); strncpy(psz_baseURL, location.utf8characters, location.utf8length);
...@@ -272,6 +272,7 @@ VlcPlugin::~VlcPlugin() ...@@ -272,6 +272,7 @@ VlcPlugin::~VlcPlugin()
free(psz_baseURL); free(psz_baseURL);
free(psz_target); free(psz_target);
free(psz_text); free(psz_text);
if( libvlc_media_player ) if( libvlc_media_player )
libvlc_media_player_release( libvlc_media_player ); libvlc_media_player_release( libvlc_media_player );
if( libvlc_media_list ) if( libvlc_media_list )
...@@ -426,9 +427,9 @@ int VlcPlugin::get_fullscreen( libvlc_exception_t *ex ) ...@@ -426,9 +427,9 @@ int VlcPlugin::get_fullscreen( libvlc_exception_t *ex )
return r; return r;
} }
int VlcPlugin::player_has_vout( libvlc_exception_t *ex ) bool VlcPlugin::player_has_vout( libvlc_exception_t *ex )
{ {
int r = 0; bool r = false;
if( playlist_isplaying(ex) ) if( playlist_isplaying(ex) )
r = libvlc_media_player_has_vout(libvlc_media_player, ex); r = libvlc_media_player_has_vout(libvlc_media_player, ex);
return r; return r;
...@@ -475,7 +476,7 @@ relativeurl: ...@@ -475,7 +476,7 @@ relativeurl:
if( psz_baseURL ) if( psz_baseURL )
{ {
size_t baseLen = strlen(psz_baseURL); size_t baseLen = strlen(psz_baseURL);
char *href = static_cast<char*>(malloc(baseLen+strlen(url)+1)); char *href = (char *) malloc(baseLen+strlen(url)+1);
if( href ) if( href )
{ {
/* prepend base URL */ /* prepend base URL */
...@@ -519,7 +520,7 @@ relativeurl: ...@@ -519,7 +520,7 @@ relativeurl:
if( '/' != *href ) if( '/' != *href )
{ {
/* baseURL is not an absolute path */ /* baseURL is not an absolute path */
free(href); free(href);
return NULL; return NULL;
} }
pathstart = href; pathstart = href;
......
...@@ -194,7 +194,7 @@ public: ...@@ -194,7 +194,7 @@ public:
void set_fullscreen( int, libvlc_exception_t * ); void set_fullscreen( int, libvlc_exception_t * );
int get_fullscreen( libvlc_exception_t * ); int get_fullscreen( libvlc_exception_t * );
int player_has_vout( libvlc_exception_t * ); bool player_has_vout( libvlc_exception_t * );
private: private:
bool playlist_select(int,libvlc_exception_t *); bool playlist_select(int,libvlc_exception_t *);
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
/***************************************************************************** /*****************************************************************************
* Unix-only declarations * Unix-only declarations
******************************************************************************/ ******************************************************************************/
#ifdef XP_UNIX #if defined(XP_UNIX)
static void Redraw( Widget w, XtPointer closure, XEvent *event ); static void Redraw( Widget w, XtPointer closure, XEvent *event );
static void ControlHandler( Widget w, XtPointer closure, XEvent *event ); static void ControlHandler( Widget w, XtPointer closure, XEvent *event );
...@@ -199,7 +199,7 @@ int16 NPP_HandleEvent( NPP instance, void * event ) ...@@ -199,7 +199,7 @@ int16 NPP_HandleEvent( NPP instance, void * event )
const NPWindow& npwindow = p_plugin->getWindow(); const NPWindow& npwindow = p_plugin->getWindow();
if( npwindow.window ) if( npwindow.window )
{ {
int hasVout = FALSE; bool hasVout = false;
if( p_plugin->playlist_isplaying(&ex) ) if( p_plugin->playlist_isplaying(&ex) )
{ {
...@@ -357,7 +357,7 @@ NPError NPP_Destroy( NPP instance, NPSavedData** save ) ...@@ -357,7 +357,7 @@ NPError NPP_Destroy( NPP instance, NPSavedData** save )
NPError NPP_SetWindow( NPP instance, NPWindow* window ) NPError NPP_SetWindow( NPP instance, NPWindow* window )
{ {
#if defined(XP_UNIX) && !defined(__APPLE__) #if defined(XP_UNIX)
Window control; Window control;
unsigned int i_control_height = 0, i_control_width = 0; unsigned int i_control_height = 0, i_control_width = 0;
#endif #endif
...@@ -375,7 +375,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window ) ...@@ -375,7 +375,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
return NPERR_NO_ERROR; return NPERR_NO_ERROR;
} }
#if defined(XP_UNIX) && !defined(__APPLE__) #if defined(XP_UNIX)
control = p_plugin->getControlWindow(); control = p_plugin->getControlWindow();
#endif #endif
...@@ -482,7 +482,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window ) ...@@ -482,7 +482,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
} }
#endif /* XP_WIN */ #endif /* XP_WIN */
#ifdef XP_UNIX #if defined(XP_UNIX)
/* default to hidden toolbar, shown at the end of this method if asked * /* default to hidden toolbar, shown at the end of this method if asked *
* developers note : getToolbarSize need to wait the end of this method * developers note : getToolbarSize need to wait the end of this method
*/ */
...@@ -763,7 +763,7 @@ static LRESULT CALLBACK Manage( HWND p_hwnd, UINT i_msg, WPARAM wpar, LPARAM lpa ...@@ -763,7 +763,7 @@ static LRESULT CALLBACK Manage( HWND p_hwnd, UINT i_msg, WPARAM wpar, LPARAM lpa
/****************************************************************************** /******************************************************************************
* UNIX-only methods * UNIX-only methods
*****************************************************************************/ *****************************************************************************/
#ifdef XP_UNIX #if defined(XP_UNIX)
static void Redraw( Widget w, XtPointer closure, XEvent *event ) static void Redraw( Widget w, XtPointer closure, XEvent *event )
{ {
VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(closure); VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(closure);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment