[vlc-devel] commit: mozilla: no functional changes (Jean-Paul Saman )
git version control
git at videolan.org
Tue Feb 17 12:42:14 CET 2009
vlc | branch: master | Jean-Paul Saman <jean-paul.saman at m2x.nl> | Fri Feb 13 16:22:51 2009 +0100| [98727134d5694e045b5d7bc1fa69c6f317583d9e] | committer: Jean-Paul Saman
mozilla: no functional changes
* Rename i_playing to is_playing
* Handle case of p_md being NULL.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=98727134d5694e045b5d7bc1fa69c6f317583d9e
---
projects/mozilla/vlcplugin.cpp | 39 ++++++++++++++++++++-------------------
1 files changed, 20 insertions(+), 19 deletions(-)
diff --git a/projects/mozilla/vlcplugin.cpp b/projects/mozilla/vlcplugin.cpp
index 54072f1..b0484f5 100644
--- a/projects/mozilla/vlcplugin.cpp
+++ b/projects/mozilla/vlcplugin.cpp
@@ -1,7 +1,7 @@
/*****************************************************************************
* vlcplugin.cpp: a VLC plugin for Mozilla
*****************************************************************************
- * Copyright (C) 2002-2008 the VideoLAN team
+ * Copyright (C) 2002-2009 the VideoLAN team
* $Id$
*
* Authors: Samuel Hocevar <sam at zoy.org>
@@ -118,7 +118,6 @@ NPError VlcPlugin::init(int argc, char* const argn[], char* const argv[])
ppsz_argv[ppsz_argc++] = "--no-media-library";
ppsz_argv[ppsz_argc++] = "--ignore-config";
ppsz_argv[ppsz_argc++] = "--intf=dummy";
-
const char *progid = NULL;
/* parse plugin arguments */
@@ -560,7 +559,7 @@ void VlcPlugin::redrawToolbar()
libvlc_media_player_t *p_md = NULL;
libvlc_exception_t ex;
float f_position = 0.0;
- int i_playing = 0;
+ int is_playing = 0;
bool b_mute = false;
unsigned int dst_x, dst_y;
GC gc;
@@ -581,23 +580,25 @@ void VlcPlugin::redrawToolbar()
libvlc_exception_init( &ex );
p_md = libvlc_playlist_get_media_player( getVLC(), &ex );
libvlc_exception_clear( &ex );
+ if( p_md )
+ {
+ /* get isplaying */
+ is_playing = libvlc_playlist_isplaying( getVLC(), &ex );
+ libvlc_exception_clear( &ex );
- /* get isplaying */
- i_playing = libvlc_playlist_isplaying( getVLC(), &ex );
- libvlc_exception_clear( &ex );
+ /* get movie position in % */
+ if( is_playing == 1 )
+ {
+ f_position = libvlc_media_player_get_position( p_md, &ex ) * 100.0;
+ libvlc_exception_clear( &ex );
+ }
+ libvlc_media_player_release( p_md );
+ }
/* get mute info */
b_mute = libvlc_audio_get_mute( getVLC(), &ex );
libvlc_exception_clear( &ex );
- /* get movie position in % */
- if( i_playing == 1 )
- {
- f_position = libvlc_media_player_get_position( p_md, &ex ) * 100;
- libvlc_exception_clear( &ex );
- }
- libvlc_media_player_release( p_md );
-
gcv.foreground = BlackPixel( p_display, 0 );
gc = XCreateGC( p_display, control, GCForeground, &gcv );
@@ -610,7 +611,7 @@ void VlcPlugin::redrawToolbar()
dst_x = BTN_SPACE;
dst_y = i_tb_height >> 1; /* baseline = vertical middle */
- if( p_btnPause && (i_playing == 1) )
+ if( p_btnPause && (is_playing == 1) )
{
XPutImage( p_display, control, gc, p_btnPause, 0, 0, dst_x,
dst_y - (p_btnPause->height >> 1),
@@ -677,7 +678,7 @@ void VlcPlugin::redrawToolbar()
vlc_toolbar_clicked_t VlcPlugin::getToolbarButtonClicked( int i_xpos, int i_ypos )
{
unsigned int i_dest = BTN_SPACE;//(i_tb_height >> 1);
- int i_playing = 0;
+ int is_playing = 0;
bool b_mute = false;
libvlc_exception_t ex;
@@ -695,7 +696,7 @@ vlc_toolbar_clicked_t VlcPlugin::getToolbarButtonClicked( int i_xpos, int i_ypos
/* get isplaying */
libvlc_exception_init( &ex );
- i_playing = libvlc_playlist_isplaying( getVLC(), &ex );
+ is_playing = libvlc_playlist_isplaying( getVLC(), &ex );
libvlc_exception_clear( &ex );
/* get mute info */
@@ -703,7 +704,7 @@ vlc_toolbar_clicked_t VlcPlugin::getToolbarButtonClicked( int i_xpos, int i_ypos
libvlc_exception_clear( &ex );
/* is Pause of Play button clicked */
- if( (i_playing != 1) &&
+ if( (is_playing != 1) &&
(i_xpos >= (BTN_SPACE>>1)) &&
(i_xpos <= i_dest + p_btnPlay->width + (BTN_SPACE>>1)) )
return clicked_Play;
@@ -712,7 +713,7 @@ vlc_toolbar_clicked_t VlcPlugin::getToolbarButtonClicked( int i_xpos, int i_ypos
return clicked_Pause;
/* is Stop button clicked */
- if( i_playing != 1 )
+ if( is_playing != 1 )
i_dest += (p_btnPlay->width + (BTN_SPACE>>1));
else
i_dest += (p_btnPause->width + (BTN_SPACE>>1));
More information about the vlc-devel
mailing list