diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | cfgparser.c | 3 | ||||
-rw-r--r-- | cfgparser.h | 2 | ||||
-rw-r--r-- | libvo/vo_sdl.c | 23 | ||||
-rw-r--r-- | mencoder.c | 4 | ||||
-rw-r--r-- | mplayer.c | 14 |
6 files changed, 40 insertions, 8 deletions
@@ -50,7 +50,7 @@ COMMON_LIBS = $(CODEC_LIBS) libmpdemux/libmpdemux.a input/libinput.a postproc/li ifeq ($(VIDIX),yes) MISC_LIBS += -Llibdha -ldha vidix/libvidix.a endif -CFLAGS = $(OPTFLAGS) -Ilibmpdemux -Iloader $(VO_INC) $(EXTRA_INC) $(CDPARANOIA_INC) $(FREETYPE_INC) # -Wall +CFLAGS = $(OPTFLAGS) -Ilibmpdemux -Iloader $(VO_INC) $(EXTRA_INC) $(CDPARANOIA_INC) $(FREETYPE_INC) $(SDL_INC) # -Wall PARTS = libfame libmpdemux libmpcodecs mp3lib liba52 libmp1e libmpeg2 libavcodec libao2 drivers linux postproc input libmpdvdkit libvo ifeq ($(VIDIX),yes) diff --git a/cfgparser.c b/cfgparser.c index d6aea51a71..b0799e0562 100644 --- a/cfgparser.c +++ b/cfgparser.c @@ -1033,7 +1033,7 @@ out: 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; @@ -1044,7 +1044,6 @@ int m_config_parse_command_line(m_config_t *config, int argc, char **argv, char assert(config != NULL); assert(config->pt != NULL); assert(argv != NULL); - assert(envp != NULL); assert(argc >= 1); #endif diff --git a/cfgparser.h b/cfgparser.h index f4b52c2a01..f860a3cd52 100644 --- a/cfgparser.h +++ b/cfgparser.h @@ -95,7 +95,7 @@ int m_config_parse_config_file(m_config_t *config, char *conffile); * -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); diff --git a/libvo/vo_sdl.c b/libvo/vo_sdl.c index ba7070a9ce..5ca488c1c7 100644 --- a/libvo/vo_sdl.c +++ b/libvo/vo_sdl.c @@ -731,6 +731,29 @@ static void set_fullmode (int mode) { /* 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) { diff --git a/mencoder.c b/mencoder.c index 949aad3d01..1f9208a9b2 100644 --- a/mencoder.c +++ b/mencoder.c @@ -295,7 +295,7 @@ void mencoder_write_chunk(aviwrite_stream_t *s,int len,unsigned int flags){ } -int main(int argc,char* argv[], char *envp[]){ +int main(int argc,char* argv[]){ stream_t* stream=NULL; demuxer_t* demuxer=NULL; @@ -373,7 +373,7 @@ if(!parse_codec_cfg(get_path("codecs.conf"))){ 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); @@ -469,7 +469,17 @@ static int libmpdemux_was_interrupted(int eof) { return eof; } -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[]){ + static demux_stream_t *d_audio=NULL; @@ -564,7 +574,7 @@ int gui_no_filename=0; if ( use_gui ) cfg_read(); #endif - 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) { |