[MPlayer-dev-eng] [PATCH] GUI: segfault in gtk/menu.c

Stanislav Maslovski stanislav.maslovski at gmail.com
Mon Apr 10 21:43:23 CEST 2006


On Mon, Apr 10, 2006 at 01:53:09PM +0200, Guillaume Poirier wrote:
> Hi,
> 
> Stanislav Maslovski wrote:
> 
> > Noticed another segfault when playing a DVD disk in gmplayer.
> > To reproduce play a short DVD clip (DVD->Play disc, DVD->Titles) and after
> > it finishes try to invoke the menu by right-clicking on MPlayer's window
> > => segfault.
> > 
> > The segfault happens at line 492 of Gui/mplayer/gtk/menu.c. The reason of it
> > is not updating the guiIntfStruct.demuxer pointer on the end of the play.
> > This should be done by sending a notification event from within mplayer.c.
> > (the gui events themselves are handled in Gui/interface.c).
> > 
> > The patch is attached.
> > 
> > --
> > Stanislav
> > 
> > 
> > ------------------------------------------------------------------------
> > 
> > Index: mplayer.c
> > ===================================================================
> > RCS file: /cvsroot/mplayer/main/mplayer.c,v
> > retrieving revision 1.927
> > diff -u -r1.927 mplayer.c
> > --- mplayer.c	6 Apr 2006 12:12:08 -0000	1.927
> > +++ mplayer.c	10 Apr 2006 10:08:41 -0000
> > @@ -4972,6 +4972,7 @@
> >  #ifdef HAVE_NEW_GUI
> >   if( use_gui && !playtree_iter ) 
> >    {
> > +   guiGetEvent( guiSetDemuxer,NULL ); 
> >  #ifdef USE_DVDREAD
> >     if ( !guiIntfStruct.DiskChanged ) 
> >  #endif
> > 
> > 
> > ------------------------------------------------------------------------
> 
> Even though I don't like the idea of putting yet some more core to
> mplayer.c, I'm not sure if there's many alternative solutions to fix the
> problem....
> 
> Can't the GUI know that the playback of a file has just finised, and
> call guiGetEvent( guiSetDemuxer,NULL ) itself?

The new patch has the same effect, but does not touch mplayer.c. Attached.

--
Stanislav
-------------- next part --------------
Index: Gui/interface.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/interface.c,v
retrieving revision 1.108
diff -u -b -r1.108 interface.c
--- Gui/interface.c	27 Mar 2006 11:39:26 -0000	1.108
+++ Gui/interface.c	10 Apr 2006 19:28:53 -0000
@@ -738,6 +738,7 @@
 	  dvd_title=0;
 	  force_fps=0;
 	 }				
+	guiIntfStruct.demuxer=NULL;
 	wsPostRedisplay( &appMPlayer.subWindow );
 	break;
    case guiSetParameters:


More information about the MPlayer-dev-eng mailing list