[MPlayer-dev-eng] liba52 problem

Donnie Smith xc0bead2d8130df59 at f4n.org
Tue Aug 13 23:15:16 CEST 2002


On Tue, Aug 13, 2002 at 21:55:24 +0200, Felix Buenemann wrote:
> Yes, I suggested some changes and still waiting for an updated patch.
I didn't understand you wanted an updated patch. Anyhow, the reason I did a
simple envp = environ "hack" is that I wanted to change as little as possible.
Removing envp requires changes in cfgparser.h, cfgparser.c, memcoder.c and
mplayer.c.

However, attached is a patch that removes envp. Since you're the maintainer
of vo_sdl.c, perhaps you could take a look at that code and remove the
comments (added by the patch) that add confusion. :)
-------------- next part --------------
--- mplayer.c.orig	Tue Aug 13 22:18:22 2002
+++ mplayer.c	Tue Aug 13 22:19:50 2002
@@ -482,7 +482,17 @@
 #endif
 }
 
-int main(int argc,char* argv[], char *envp[]){
+/*
+ * In Mac OS X the SDL-lib is built upon Cocoa. The easiest way to
+ * make it all work is to use the builtin SDL-bootstrap code, which 
+ * will be done automatically by replacing our main() if we include SDL.h.
+ */
+#if defined(SYS_DARWIN) && defined(HAVE_SDL)
+#include <SDL.h>
+#endif
+
+int main(int argc,char* argv[]){
+

 #ifdef USE_SUB
 static subtitle* subtitles=NULL;
@@ -584,7 +594,7 @@
 
 
 
-    if(m_config_parse_command_line(mconfig, argc, argv, envp) < 0) exit(1); // error parsing cmdline
+    if(m_config_parse_command_line(mconfig, argc, argv) < 0) exit(1); // error parsing cmdline
 
     playtree = play_tree_cleanup(playtree);
     if(playtree) {
--- Makefile.orig	Tue Aug 13 22:18:16 2002
+++ Makefile	Tue Aug 13 22:18:40 2002
@@ -55,7 +55,7 @@
 ifeq ($(VIDIX),yes)
 MISC_LIBS += -Llibdha -ldha -Lvidix -lvidix
 endif
-CFLAGS = $(OPTFLAGS) -Ilibmpdemux -Iloader $(VO_INC) $(EXTRA_INC) $(CDPARANOIA_INC)# -Wall
+CFLAGS = $(OPTFLAGS) -Ilibmpdemux -Iloader $(VO_INC) $(EXTRA_INC) $(CDPARANOIA_INC) $(SDL_INC)# -Wall
 
 PARTS = libfame libmpdemux libmpcodecs mp3lib liba52 libmp1e libmpeg2 libavcodec libao2 drivers linux postproc input libmpdvdkit
 ifeq ($(VIDIX),yes)
--- libvo/vo_sdl.c.orig	Tue Aug 13 22:18:33 2002
+++ libvo/vo_sdl.c	Tue Aug 13 22:18:44 2002
@@ -730,6 +730,29 @@
 	/* try to change to given fullscreenmode */
 	newsurface = SDL_SetVideoMode(priv->dstwidth, screen_surface_h, priv->bpp,
                                   priv->sdlfullflags);
+
+	/*
+	 * In Mac OS X (and possibly others?) SDL_SetVideoMode() appears to 
+	 * destroy the datastructure previously retrived, so we need to 
+	 * re-assign it.  The comment in sdl_close() seems to imply that we 
+	 * should not free() anything.
+	 */
+	#ifdef SYS_DARWIN
+	{
+	const SDL_VideoInfo *vidInfo = NULL;
+	vidInfo = SDL_GetVideoInfo ();
+
+	/* collect all fullscreen & hardware modes available */
+	if (!(priv->fullmodes = SDL_ListModes (vidInfo->vfmt, priv->sdlfullflags))) {
+
+	    /* non hardware accelerated fullscreen modes */
+	    priv->sdlfullflags &= ~SDL_HWSURFACE;
+	    priv->fullmodes = SDL_ListModes (vidInfo->vfmt, priv->sdlfullflags);
+	}
+	}
+	#endif
+
+
 	
 	/* if creation of new surface was successfull, save it and hide mouse cursor */
 	if(newsurface) {
--- mencoder.c.orig	Tue Aug 13 22:20:07 2002
+++ mencoder.c	Tue Aug 13 22:24:36 2002
@@ -290,7 +290,7 @@
 }
 
 
-int main(int argc,char* argv[], char *envp[]){
+int main(int argc,char* argv[]){
 
 stream_t* stream=NULL;
 demuxer_t* demuxer=NULL;
@@ -368,7 +368,7 @@
   me_register_options(mconfig);
   parse_cfgfiles(mconfig);
 
-  if(m_config_parse_command_line(mconfig, argc, argv, envp) < 0) mencoder_exit(1, "error parsing cmdline");
+  if(m_config_parse_command_line(mconfig, argc, argv) < 0) mencoder_exit(1, "error parsing cmdline");
   playtree = play_tree_cleanup(playtree);
   if(playtree) {
     playtree_iter = play_tree_iter_new(playtree,mconfig);
--- cfgparser.c.orig	Tue Aug 13 22:26:43 2002
+++ cfgparser.c	Tue Aug 13 22:24:56 2002
@@ -989,7 +989,7 @@
 	return ret;
 }
 
-int m_config_parse_command_line(m_config_t *config, int argc, char **argv, char **envp)
+int m_config_parse_command_line(m_config_t *config, int argc, char **argv)
 {
 	int i;
 	int tmp;
@@ -1000,7 +1000,6 @@
 	assert(config != NULL);
 	assert(config->pt != NULL);
 	assert(argv != NULL);
-	assert(envp != NULL);
 	assert(argc >= 1);
 #endif
 	
--- cfgparser.h.orig	Tue Aug 13 22:26:47 2002
+++ cfgparser.h	Tue Aug 13 22:25:12 2002
@@ -93,7 +93,7 @@
  * 	-1 on error (invalid option...)
  * 	 1 otherwise
  */
-int m_config_parse_command_line(m_config_t* config, int argc, char **argv, char **envp);
+int m_config_parse_command_line(m_config_t* config, int argc, char **argv);
 
 m_config_t* m_config_new(play_tree_t* pt);
 


More information about the MPlayer-dev-eng mailing list