[MPlayer-dev-eng] [PATCH] Segfault fix, GUI filesel update

Panagiotis Issaris takis at lumumba.luc.ac.be
Tue Sep 24 18:17:46 CEST 2002


Hi,

The first patch attached updates the file selection dialog box to show
more supported video and audioformats. The second patch is the removal
of just 4 tabs and two spaces located on empty lines, which caused my
VIM's diffsplit to freak out. 

The third patch fixes a segfault incorrect audio or video streams were
selected:
mplayer -aid 0 -vid 1 weetge.avi


With friendly regards,
Takis
-------------- next part --------------
Index: Gui/mplayer/gtk/fs.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/gtk/fs.c,v
retrieving revision 1.31
diff -r1.31 fs.c
44c44
<          { { "MPEG files (*.mpg,*.mpeg)",                               "*.mpg,*.mpeg" },
---
>          { { "MPEG files (*.mpg,*.mpeg,*.m1v)",                         "*.mpg,*.mpeg,*.m1v" },
48c48
<            { "QT files (*.mov)",   				  	"*.mov" },
---
>            { "QuickTime files (*.mov,*.qt)",			  	"*.mov,*.qt" },
52a53,55
> 	   { "OGG Media files (*.ogm)",			  		"*.ogm" },
> 	   { "Autodesk animations (*.fli,*.flc)",			"*.fli,*.flc" },
> 	   { "NuppelVideo files (*.nuv)",				"*.nuv" },
56,57c59,60
< 	   { "Audio files (*.wav,*.mp2,*.mp3,*.wma)",			"*.wav,*.mp2,*.mp3,*.wma" },
< 	   { "All video files", 					"*.mpg,*.mpeg,*.vob,*.avi,*.divx,*.mov,*.asf,*.viv,*.rm,*.wmv" },
---
> 	   { "Audio files (*.wav,*.ogg,*.mp2,*.mp3,*.wma)",		"*.wav,*.ogg,*.mp2,*.mp3,*.wma" },
> 	   { "All video files", 					"*.mpg,*.mpeg,*.m1v,*.vob,*.avi,*.divx,*.mov,*.qt,*.asf,*.viv,*.rm,*.wmv,*.ogm,*.fli,*.flc,*.nuv" },
86c89,90
< 	   { "Audio files (*.wav,*.mp2,*.mp3)",				   "*.wav,*.mp2,*.mp3" },
---
> 	   { "OGG Vorbis files (*.ogg)",				   "*.ogg" },
> 	   { "Audio files (*.wav,*.mp2,*.mp3,*.ogg)",			   "*.wav,*.mp2,*.mp3,*.ogg" },
-------------- next part --------------
Index: help/help_mp-en.h
===================================================================
RCS file: /cvsroot/mplayer/main/help/help_mp-en.h,v
retrieving revision 1.57
diff -u -r1.57 help_mp-en.h
--- help/help_mp-en.h	22 Sep 2002 14:28:29 -0000	1.57
+++ help/help_mp-en.h	23 Sep 2002 14:54:57 -0000
@@ -257,7 +257,7 @@
 #define MSGTR_ADecoderPreinitFailed "ADecoder preinit failed :(\n"
 #define MSGTR_AllocatingBytesForInputBuffer "dec_audio: Allocating %d bytes for input buffer\n"
 #define MSGTR_AllocatingBytesForOutputBuffer "dec_audio: Allocating %d + %d = %d bytes for output buffer\n"
-			 
+
 // LIRC:
 #define MSGTR_SettingUpLIRC "Setting up lirc support...\n"
 #define MSGTR_LIRCdisabled "You won't be able to use your remote control\n"
@@ -276,7 +276,7 @@
 #define MSGTR_CouldNotFindColorspace "Couldn't find matching colorspace - retrying with -vop scale...\n"
 #define MSGTR_MovieAspectIsSet "Movie-Aspect is %.2f:1 - prescaling to correct movie aspect.\n"
 #define MSGTR_MovieAspectUndefined "Movie-Aspect is undefined - no prescaling applied.\n"
-			 
+
 // ====================== GUI messages/buttons ========================
 
 #ifdef HAVE_NEW_GUI
-------------- next part --------------
Index: libmpdemux/demux_avi.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_avi.c,v
retrieving revision 1.45
diff -u -r1.45 demux_avi.c
--- libmpdemux/demux_avi.c	22 Sep 2002 02:33:26 -0000	1.45
+++ libmpdemux/demux_avi.c	23 Sep 2002 17:05:18 -0000
@@ -32,6 +32,8 @@
   if(stream_id==demux->audio->id){
       if(!demux->audio->sh){
         demux->audio->sh=demux->a_streams[stream_id];
+	if(!demux->audio->sh)
+		return NULL;
         mp_msg(MSGT_DEMUX,MSGL_V,"Auto-selected AVI audio ID = %d\n",demux->audio->id);
 	demux->audio->block_size=((sh_audio_t*)(demux->audio->sh))->wf->nBlockAlign;
 	//printf("&&&&& setting blocksize to %d &&&&&\n",demux->audio->block_size);
@@ -41,6 +43,8 @@
   if(stream_id==demux->video->id){
       if(!demux->video->sh){
         demux->video->sh=demux->v_streams[stream_id];
+	if(!demux->video->sh)
+		return NULL;
         mp_msg(MSGT_DEMUX,MSGL_V,"Auto-selected AVI video ID = %d\n",demux->video->id);
       }
       return demux->video;


More information about the MPlayer-dev-eng mailing list