[vlc-devel] commit: [PATCH] by Anthony Loiseau <anthony.loiseau at gmail dot com>: Avoid browser crashing on mozilla-plugin when jumping into the media using the time-slider and no movie is loaded . (Jean-Paul Saman )

git version control git at videolan.org
Tue Mar 4 22:11:38 CET 2008


vlc | branch: master | Jean-Paul Saman <jpsaman at videolan.org> | Tue Mar  4 22:03:03 2008 +0100| [fded58d9efdefbc1d3d3a245f312a8ca6cb225bb]

[PATCH] by Anthony Loiseau <anthony.loiseau at gmail dot com>: Avoid browser crashing on mozilla-plugin when jumping into the media using the time-slider and no movie is loaded.

Signed-off-by: Jean-Paul Saman <jpsaman at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fded58d9efdefbc1d3d3a245f312a8ca6cb225bb
---

 projects/mozilla/vlcshell.cpp |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/projects/mozilla/vlcshell.cpp b/projects/mozilla/vlcshell.cpp
index 66a73e5..2ed67a4 100644
--- a/projects/mozilla/vlcshell.cpp
+++ b/projects/mozilla/vlcshell.cpp
@@ -811,17 +811,21 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
         /* jump in the movie */
         if( i_yPos <= (i_height-30) )
         {
-            vlc_int64_t f_length;
-            libvlc_exception_init( &ex );
-            f_length = libvlc_media_instance_get_length( p_md, &ex ) / 100;
-            libvlc_exception_clear( &ex );
+            /* if a movie is loaded */
+            if( p_md )
+            {
+                vlc_int64_t f_length;
+                libvlc_exception_init( &ex );
+                f_length = libvlc_media_instance_get_length( p_md, &ex ) / 100;
+                libvlc_exception_clear( &ex );
 
-            f_length = (float)f_length *
-                    ( ((float)i_xPos-4 ) / ( ((float)i_width-8)/100) );
+                f_length = (float)f_length *
+                        ( ((float)i_xPos-4 ) / ( ((float)i_width-8)/100) );
 
-            libvlc_exception_init( &ex );
-            libvlc_media_instance_set_time( p_md, f_length, &ex );
-            libvlc_exception_clear( &ex );
+                libvlc_exception_init( &ex );
+                libvlc_media_instance_set_time( p_md, f_length, &ex );
+                libvlc_exception_clear( &ex );
+            }
         }
 
         /* play/pause toggle */




More information about the vlc-devel mailing list