[vlc-devel] [PATCH 1/3] Qt: Run mainloop on the main thread on OSX

Juho Vähä-Herttua juhovh at iki.fi
Sun Aug 1 21:37:49 CEST 2010


On 31.7.2010, at 22.30, Rémi Denis-Courmont wrote:
> Le samedi 31 juillet 2010 22:11:11 Juho Vähä-Herttua, vous avez écrit :
>> 
>> Thank you, this conversation cleared up a lot, and I made a patch that I
>> hope is something you're after. There's only two issues I can think of:
>> 
>> 1) the variable creation is moved to RegisterIntf function, because it
>> needs to be called from two different places, avoids code duplication 2)
>> the semaphore is still created and used even on Mac OS X single thread, I
>> don't think this is an issue since it's a no-op here as you said
> 
> Merged, thanks.

I'd just like to let you know that commit 4d636fa3a74924691b0b hangs the interface on Mac after quitting. I haven't yet figured out why, since it clearly shouldn't.

>> Everything seemed to work fine when I tested, unless libvlc_Quit is called
>> during video playback as already mentioned before. That will give the good
>> old main interface destroyed before vout_window_Delete called issue:
>> 
>> Assertion failed: (!stable), function ~VideoWidget, file
>> ../../../../modules/gui/qt4/components/interface_widgets.cpp, line 81.
> 
> In principle, pl_Deactivate() will wait for the ongoing input to finish, and 
> release all the input "resources" (including the video window). Only later 
> intf_DestroyAll() will clean up all interfaces. Laurent can correct me if I am 
> wrong. But I do not understand how the race can still happen. If I recall 
> correctly, there was some anecdotal crash report evidence that it is still 
> possible on Linux/Windows as well.
> 
> At least on X11, we could ignore the problem. We could let the Qt4 thread 
> destroy the window. We just need to change WindowControl() and WindowClose() 
> to fail safely if the window was already destroyed. The owner of the video 
> window may get some errors from the X server, but nothing fatal.
> 
> I am not sure if this can work on Windows and MacOS though.

On Mac OS X it should be quite easy to do, since the whole framework memory management is based on using reference counting and as long as references to the objects are kept, it shouldn't break. I'll think about it, although if it's as Laurent said it shouldn't be necessary on other platforms. (but maybe wouldn't hurt either)


Juho

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4215 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20100801/7ffcb588/attachment.bin>


More information about the vlc-devel mailing list