[MPlayer-users] OSX crash playing audio with album art jpg

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Dec 8 15:24:43 CET 2013


On Sun, Dec 08, 2013 at 03:17:35PM +0100, Reimar Döffinger wrote:
> On Fri, Nov 22, 2013 at 12:19:28PM +0000, Alex Sisson wrote:
> > 
> > Reproduction:
> > - Play an audio file with embedded tag for folder art   (I think that's how the image gets loaded)   ...can supply files if needed for reproduction
> > - Minimize the art window
> > - Click on another app in the dock   (running or not)  (important step!)
> > - Click the mplayer dock icon
> > - Crashes!
> > 
> > 
> > System info:
> > OSX 10.8.5
> > Xcode 5.0
> 
> According to all information I can find, this:
> 2013-11-22 12:02:49.893 mplayer[55046:f0b] *** Assertion failure in -[NSWindow _changeJustMain],
> +/SourceCache/AppKit/AppKit-1187.40/AppKit.subproj/NSWindow.m:12478
> 2013-11-22 12:02:49.894 mplayer[55046:f0b] An uncaught exception was raised
> 2013-11-22 12:02:49.894 mplayer[55046:f0b] Invalid parameter not satisfying: [self canBecomeMainWindow]
> 
> Is a bug in Apple's code.
> We could catch the exception or try some other workaround, but in principle I'd
> say Apple needs to fix their code.

You could try this, but the canBecomeMainWindow documentation say if it is false
attempts to make it main window will be adandoned.
It doesn't say "will crash your application with an exception" as the 10.8 behaviour
seems to be.

--- a/libvo/osx_objc_common.m
+++ b/libvo/osx_objc_common.m
@@ -483,7 +483,7 @@ void vo_osx_swap_buffers(void)
        // on Leopard, we have trouble to get the play window automatically focused
        // when the app is actived. The Following code fix this problem.
 #ifndef CONFIG_SDL
-       if (isLeopardOrLater && [event type] == NSAppKitDefined
+       if (isLeopardOrLater && [window canBecomeMainWindow] && [event type] == NSAppKitDefined
                        && [event subtype] == NSApplicationActivatedEventType) {
                [window makeMainWindow];
                [window makeKeyAndOrderFront:self];


More information about the MPlayer-users mailing list