[MPlayer-dev-eng] [PATCH] Make mplayerosx GUI work with DLL-patched mplayer

Valtteri Vuorikoski vuori at sci.fi
Wed Jul 26 23:56:11 CEST 2006


The attached patch to mplayerosx GUI makes allows it to work with an
mplayer compiled for DLL support using my patch.

I have only been able to test this with gdb and guesswork though,
since the GUI built under 10.4.7/Intel (with or without
MACOSX_DEPLOYMENT_TARGET) only shows a black screen. Am I doing
something wrong (I just ran "make" in the mplayerosx directory)?

This isn't a problem with mplayer itself, since my mplayer binary
works playing xvid etc. with the GUI binary from the download page.

 -v

Index: Sources/Classes/MplayerInterface.m
===================================================================
--- Sources/Classes/MplayerInterface.m  (revision 118)
+++ Sources/Classes/MplayerInterface.m  (working copy)
@@ -865,6 +865,8 @@
 /************************************************************************************/
 - (void)runMplayerWithParams:(NSArray *)aParams
 {
+       NSMutableDictionary *env;
+       
        // terminate mplayer if it is running
        if (myMplayerTask) {
                if (myState == kPaused && restartingPlayer)
@@ -903,6 +905,13 @@
        
        [myMplayerTask setArguments:aParams];
 
+       // get current environment and make appropriate changes
+       env = [[[NSProcessInfo processInfo] environment] mutableCopy];
+       [env autorelease];
+       // enable bind-at-launch behavior for dyld to use DLL codecs
+       [env setObject:@"1" forKey:@"DYLD_BIND_AT_LAUNCH"];
+       [myMplayerTask setEnvironment:env];
+       
        //Print Command line to console
        NSLog(@"Path to MPlayer: %s", [myPathToPlayer UTF8String] );
        int count = 0;



More information about the MPlayer-dev-eng mailing list