Commit 396acde3 authored by Rémi Duraffort's avatar Rémi Duraffort

mozilla plugin: fix compilation.

parent 992cf22c
This diff is collapsed.
...@@ -449,7 +449,7 @@ void VlcPlugin::set_player_window() ...@@ -449,7 +449,7 @@ void VlcPlugin::set_player_window()
#endif #endif
} }
int VlcPlugin::playlist_add( const char *mrl, libvlc_exception_t *ex ) int VlcPlugin::playlist_add( const char *mrl )
{ {
int item = -1; int item = -1;
libvlc_media_t *p_m = libvlc_media_new(libvlc_instance,mrl); libvlc_media_t *p_m = libvlc_media_new(libvlc_instance,mrl);
...@@ -467,7 +467,7 @@ int VlcPlugin::playlist_add( const char *mrl, libvlc_exception_t *ex ) ...@@ -467,7 +467,7 @@ int VlcPlugin::playlist_add( const char *mrl, libvlc_exception_t *ex )
} }
int VlcPlugin::playlist_add_extended_untrusted( const char *mrl, const char *name, int VlcPlugin::playlist_add_extended_untrusted( const char *mrl, const char *name,
int optc, const char **optv, libvlc_exception_t *ex ) int optc, const char **optv )
{ {
libvlc_media_t *p_m = libvlc_media_new(libvlc_instance, mrl); libvlc_media_t *p_m = libvlc_media_new(libvlc_instance, mrl);
int item = -1; int item = -1;
...@@ -486,7 +486,7 @@ int VlcPlugin::playlist_add_extended_untrusted( const char *mrl, const char *nam ...@@ -486,7 +486,7 @@ int VlcPlugin::playlist_add_extended_untrusted( const char *mrl, const char *nam
return item; return item;
} }
bool VlcPlugin::playlist_select( int idx, libvlc_exception_t *ex ) bool VlcPlugin::playlist_select( int idx )
{ {
libvlc_media_t *p_m = NULL; libvlc_media_t *p_m = NULL;
......
...@@ -167,11 +167,10 @@ public: ...@@ -167,11 +167,10 @@ public:
NPError init(int argc, char* const argn[], char* const argv[]); NPError init(int argc, char* const argn[], char* const argv[]);
libvlc_instance_t* getVLC() libvlc_instance_t* getVLC()
{ return libvlc_instance; }; { return libvlc_instance; };
libvlc_media_player_t* getMD(libvlc_exception_t *ex) libvlc_media_player_t* getMD()
{ {
if( !libvlc_media_player ) if( !libvlc_media_player )
{ {
libvlc_exception_raise(ex);
libvlc_printerr("no mediaplayer"); libvlc_printerr("no mediaplayer");
} }
return libvlc_media_player; return libvlc_media_player;
...@@ -224,14 +223,14 @@ public: ...@@ -224,14 +223,14 @@ public:
char * psz_text; char * psz_text;
char * psz_target; char * psz_target;
void playlist_play(libvlc_exception_t *ex) void playlist_play()
{ {
if( libvlc_media_player||playlist_select(0,ex) ) if( libvlc_media_player||playlist_select(0) )
libvlc_media_player_play(libvlc_media_player); libvlc_media_player_play(libvlc_media_player);
} }
void playlist_play_item(int idx,libvlc_exception_t *ex) void playlist_play_item(int idx)
{ {
if( playlist_select(idx,ex) ) if( playlist_select(idx) )
libvlc_media_player_play(libvlc_media_player); libvlc_media_player_play(libvlc_media_player);
} }
void playlist_stop() void playlist_stop()
...@@ -239,14 +238,14 @@ public: ...@@ -239,14 +238,14 @@ public:
if( libvlc_media_player ) if( libvlc_media_player )
libvlc_media_player_stop(libvlc_media_player); libvlc_media_player_stop(libvlc_media_player);
} }
void playlist_next(libvlc_exception_t *ex) void playlist_next()
{ {
if( playlist_select(playlist_index+1,ex) ) if( playlist_select(playlist_index+1) )
libvlc_media_player_play(libvlc_media_player); libvlc_media_player_play(libvlc_media_player);
} }
void playlist_prev(libvlc_exception_t *ex) void playlist_prev()
{ {
if( playlist_select(playlist_index-1,ex) ) if( playlist_select(playlist_index-1) )
libvlc_media_player_play(libvlc_media_player); libvlc_media_player_play(libvlc_media_player);
} }
void playlist_pause() void playlist_pause()
...@@ -263,9 +262,9 @@ public: ...@@ -263,9 +262,9 @@ public:
return is_playing; return is_playing;
} }
int playlist_add( const char *, libvlc_exception_t * ); int playlist_add( const char * );
int playlist_add_extended_untrusted( const char *, const char *, int, int playlist_add_extended_untrusted( const char *, const char *, int,
const char **, libvlc_exception_t * ); const char ** );
int playlist_delete_item( int ); int playlist_delete_item( int );
void playlist_clear(); void playlist_clear();
int playlist_count(); int playlist_count();
...@@ -281,7 +280,7 @@ public: ...@@ -281,7 +280,7 @@ public:
EventObj events; EventObj events;
private: private:
bool playlist_select(int,libvlc_exception_t *); bool playlist_select(int);
void set_player_window(); void set_player_window();
/* VLC reference */ /* VLC reference */
......
...@@ -157,9 +157,6 @@ NPError NPP_SetValue( NPP instance, NPNVariable variable, void *value ) ...@@ -157,9 +157,6 @@ NPError NPP_SetValue( NPP instance, NPNVariable variable, void *value )
int16 NPP_HandleEvent( NPP instance, void * event ) int16 NPP_HandleEvent( NPP instance, void * event )
{ {
static UInt32 lastMouseUp = 0; static UInt32 lastMouseUp = 0;
libvlc_exception_t ex;
libvlc_exception_init(&ex);
if( instance == NULL ) if( instance == NULL )
{ {
return false; return false;
...@@ -182,8 +179,7 @@ int16 NPP_HandleEvent( NPP instance, void * event ) ...@@ -182,8 +179,7 @@ int16 NPP_HandleEvent( NPP instance, void * event )
if( (myEvent->when - lastMouseUp) < GetDblTime() ) if( (myEvent->when - lastMouseUp) < GetDblTime() )
{ {
/* double click */ /* double click */
p_plugin->toggle_fullscreen(&ex); p_plugin->toggle_fullscreen();
libvlc_exception_clear(&ex);
} }
return true; return true;
} }
...@@ -212,13 +208,12 @@ int16 NPP_HandleEvent( NPP instance, void * event ) ...@@ -212,13 +208,12 @@ int16 NPP_HandleEvent( NPP instance, void * event )
area.top = 0; area.top = 0;
area.right = npwindow.width; area.right = npwindow.width;
area.bottom = npwindow.height; area.bottom = npwindow.height;
libvlc_video_redraw_rectangle(p_plugin->getMD(&ex), &area, NULL); libvlc_video_redraw_rectangle(p_plugin->getMD(), &area, NULL);
#else #else
#warning disabled code #warning disabled code
#endif #endif
} }
} }
libvlc_exception_clear(&ex);
if( ! hasVout ) if( ! hasVout )
{ {
...@@ -372,9 +367,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window ) ...@@ -372,9 +367,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
control = p_plugin->getControlWindow(); control = p_plugin->getControlWindow();
#endif #endif
libvlc_exception_t ex;
libvlc_exception_init(&ex);
libvlc_instance_t *p_vlc = p_plugin->getVLC(); libvlc_instance_t *p_vlc = p_plugin->getVLC();
/* /*
...@@ -413,8 +405,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window ) ...@@ -413,8 +405,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
clip.bottom = window->clipRect.bottom; clip.bottom = window->clipRect.bottom;
clip.right = window->clipRect.right; clip.right = window->clipRect.right;
#ifdef NOT_WORKING #ifdef NOT_WORKING
libvlc_video_set_viewport(p_vlc, p_plugin->getMD(&ex), &view, &clip, &ex); libvlc_video_set_viewport(p_vlc, p_plugin->getMD(), &view, &clip);
libvlc_exception_clear(&ex);
#else #else
#warning disabled code #warning disabled code
#endif #endif
...@@ -548,12 +539,11 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window ) ...@@ -548,12 +539,11 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
{ {
if( p_plugin->psz_target ) if( p_plugin->psz_target )
{ {
if( p_plugin->playlist_add( p_plugin->psz_target, NULL ) != -1 ) if( p_plugin->playlist_add( p_plugin->psz_target ) != -1 )
{ {
if( p_plugin->b_autoplay ) if( p_plugin->b_autoplay )
{ {
p_plugin->playlist_play(&ex); p_plugin->playlist_play();
libvlc_exception_clear(&ex);
} }
} }
p_plugin->b_stream = true; p_plugin->b_stream = true;
...@@ -627,11 +617,11 @@ void NPP_StreamAsFile( NPP instance, NPStream *stream, const char* fname ) ...@@ -627,11 +617,11 @@ void NPP_StreamAsFile( NPP instance, NPStream *stream, const char* fname )
return; return;
} }
if( p_plugin->playlist_add( stream->url, NULL ) != -1 ) if( p_plugin->playlist_add( stream->url ) != -1 )
{ {
if( p_plugin->b_autoplay ) if( p_plugin->b_autoplay )
{ {
p_plugin->playlist_play(NULL); p_plugin->playlist_play();
} }
} }
} }
...@@ -806,11 +796,8 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event ) ...@@ -806,11 +796,8 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
if( p_plugin && p_plugin->b_toolbar ) if( p_plugin && p_plugin->b_toolbar )
{ {
int i_playing; int i_playing;
libvlc_exception_t ex;
libvlc_exception_init( &ex ); libvlc_media_player_t *p_md = p_plugin->getMD();
libvlc_media_player_t *p_md = p_plugin->getMD(&ex);
libvlc_exception_clear( &ex );
i_playing = p_plugin->playlist_isplaying(); i_playing = p_plugin->playlist_isplaying();
...@@ -824,9 +811,7 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event ) ...@@ -824,9 +811,7 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
if( i_playing == 1 ) if( i_playing == 1 )
p_plugin->playlist_pause(); p_plugin->playlist_pause();
else else
p_plugin->playlist_play( &ex ); p_plugin->playlist_play();
libvlc_exception_clear( &ex );
} }
break; break;
......
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