[vlc-devel] [PATCH 6/6] Update the MonitorLibVLCDeath hack to work on libvlc_Quit
Juho Vähä-Herttua
juhovh at iki.fi
Sat Jul 24 23:54:35 CEST 2010
On 24.7.2010, at 23.58, Rémi Denis-Courmont wrote:
> Le samedi 24 juillet 2010 23:31:14 Juho Vähä-Herttua, vous avez écrit :
>> ---
>> src/interface/interface.c | 8 ++++++--
>> 1 files changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/interface/interface.c b/src/interface/interface.c
>> index 5c674d2..294f509 100644
>> --- a/src/interface/interface.c
>> +++ b/src/interface/interface.c
>> @@ -201,7 +201,8 @@ void intf_DestroyAll( libvlc_int_t *p_libvlc )
>>
>> if( p_intf->pf_run )
>> vlc_thread_join( p_intf );
>> - module_unneed( p_intf, p_intf->p_module );
>> + if( p_intf->p_module )
>> + module_unneed( p_intf, p_intf->p_module );
>
> This does not really make sense. If there is no module, then the interface
> creation failed, so we cannot reach that code.
And in addition to that, I think the patch has a race condition, so it shouldn't be merged like this. However, my problem here is that in MonitorLibVLCDeath function I need to be able to somehow call the interface Close() function to get it out of the main loop. The original code called "vlc_object_kill( p_intf )" which doesn't seem to do the job however. I noticed that module_unneed calls the Close(), therefore I "fixed" it by calling module_unneed and removing the second cleanup call to module_unneed here.
Does someone have better suggestions? I think one way would be to set the p_module->pf_deactivate function as NULL and then call it manually, but it makes me feel almost dirtier. :P
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/20100725/4a7f8d68/attachment.bin>
More information about the vlc-devel
mailing list