summaryrefslogtreecommitdiffstats
path: root/macosx/main.mm
diff options
context:
space:
mode:
authorsr55 <[email protected]>2013-01-27 19:42:52 +0000
committersr55 <[email protected]>2013-01-27 19:42:52 +0000
commite40171b47fcf64b27ca3ec3b61e412f3354ba05c (patch)
tree1cd357a3af02c8c43c920dfcfea4d4cbd4d489af /macosx/main.mm
parent8feea17105d6df8114447d66028673920abc548b (diff)
Remove the deprecated VLC DYLD code
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5209 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/main.mm')
-rw-r--r--macosx/main.mm80
1 files changed, 4 insertions, 76 deletions
diff --git a/macosx/main.mm b/macosx/main.mm
index 260a8ad92..24cd7547f 100644
--- a/macosx/main.mm
+++ b/macosx/main.mm
@@ -23,10 +23,10 @@ void SigHandler( int signal )
* this is the only place I could find that looked like C :)
****************************************************************************/
extern "C" {
-void hb_error_handler( const char *errmsg )
-{
- fprintf(stderr, "GUI ERROR dialog: %s\n", errmsg );
-}
+ void hb_error_handler( const char *errmsg )
+ {
+ fprintf(stderr, "GUI ERROR dialog: %s\n", errmsg );
+ }
}
char * str_printf(const char *fmt, ...)
@@ -64,80 +64,8 @@ char * str_printf(const char *fmt, ...)
}
}
-#define EXTRA_VLC_DYLD_PATH "/Applications/VLC.app/Contents/MacOS/lib"
-#define DEFAULT_DYLD_PATH "/usr/local/lib:/usr/lib"
-
int main( int argc, const char ** argv )
{
- char *dylib_path;
- int no_exec = 0;
-
- // Check for flag that prevents exec bomb. It
- // incidentally can be used to prevent adding
- // our modifications to the dyld env vars.
- if ( argc > 1 && strncmp(argv[1], "-n", 2) == 0 )
- no_exec = 1;
-
- if ( !no_exec )
- {
- dylib_path = getenv("DYLD_FALLBACK_LIBRARY_PATH");
- if ( dylib_path == NULL ||
- strstr( dylib_path, "/Applications/VLC.app/Contents/MacOS/lib" ) == NULL )
- {
- char *path = NULL;
- char *home;
- int result = -1;
-
- home = getenv("HOME");
-
- if ( dylib_path == NULL )
- {
- // Set the system default of $HOME/lib:/usr/local/lib:/usr/lib
- // And add our extra path
- if ( home != NULL )
- {
- path = str_printf("%s/lib:%s:%s:%s%s", home,
- DEFAULT_DYLD_PATH,
- EXTRA_VLC_DYLD_PATH,
- home, EXTRA_VLC_DYLD_PATH);
- }
- else
- {
- path = str_printf("%s:%s", DEFAULT_DYLD_PATH, EXTRA_VLC_DYLD_PATH);
- }
- if ( path != NULL )
- result = setenv("DYLD_FALLBACK_LIBRARY_PATH", path, 1);
- }
- else
- {
- // add our extra path
- if ( home != NULL )
- {
- path = str_printf("%s:%s:%s%s", dylib_path, EXTRA_VLC_DYLD_PATH,
- home, EXTRA_VLC_DYLD_PATH);
- }
- else
- {
- path = str_printf("%s:%s", dylib_path, EXTRA_VLC_DYLD_PATH);
- }
- if ( path != NULL )
- result = setenv("DYLD_FALLBACK_LIBRARY_PATH", path, 1);
- }
- if ( result == 0 )
- {
- const char ** new_argv;
- int i;
-
- new_argv = (const char**)malloc( (argc + 2) * sizeof(char*) );
- new_argv[0] = argv[0];
- new_argv[1] = "-n";
- for (i = 1; i < argc; i++)
- new_argv[i+1] = argv[i];
- new_argv[i+1] = NULL;
- execv(new_argv[0], (char* const*)new_argv);
- }
- }
- }
signal( SIGINT, SigHandler );
hb_register_error_handler(&hb_error_handler);
return NSApplicationMain( argc, argv );