[vlc-devel] [vlc-commits] Qt: add deduplication for some events.

Ilkka Ollakka ileoo at videolan.org
Wed Aug 22 16:14:11 CEST 2012


On Thu, Aug 16, 2012 at 03:30:02PM +0200, Francois Cartegnie wrote:
> vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Aug 16 15:06:25 2012 +0200| [541c1d97c0087c5de559b9793f42ea698f8c284e] | committer: Francois Cartegnie

> Qt: add deduplication for some events.

> Some events are fired on each meta type detection, while we just handle
> those events on a global change basis.
> Qt has some similar deduplication for repaint() or touch events, but
> does not provide it to user.

Hi,

I think this commit causes segfaults for me when opening bigger
directories (around 3000 files).

> +void RateLimitedEventPoster::postEvent( UniqueEvent *e, QObject *target )
> +{
> +    event_tuple newtuple = { target, e };
> +    foreach( event_tuple tuple, eventsList )
> +    {
> +        if ( target == tuple.target && tuple.event->equals( e ) )
> +        {
> +            delete e;
> +            return;
> +        }
> +    }
> +    eventsList << newtuple;
> +    if ( !timer->isActive() ) timer->start();
> +}
> +
> +void RateLimitedEventPoster::commit()
> +{
> +    foreach( event_tuple tuple, eventsList )
> +    {
> +        QApplication::postEvent( tuple.target, tuple.event );
> +    }
> +    eventsList.clear();
> +}
These two don't happen at same time?

Backtrace for my crash is following:
#0  0x00007ffff6880d95 in raise () from /lib64/libc.so.6
#1  0x00007ffff68822ab in abort () from /lib64/libc.so.6
#2  0x00007ffff68bc99e in __libc_message () from /lib64/libc.so.6
#3  0x00007ffff68c26d6 in malloc_printerr () from /lib64/libc.so.6
#4  0x00007ffff268529c in ~QForeachContainer (this=0x7fffecb897b0, __in_chrg=<optimized out>) at /usr/include/QtCore/qglobal.h:2343
#5  RateLimitedEventPoster::postEvent (this=0x7fffe01f06c0, e=0x7fffc8235fa0, target=0x7fffe01f0580) at ../../../../vlc/modules/gui/qt4/util/uniqueevent.cpp:46
#6  0x00007ffff258bede in postUniqueEvent (e=0x7fffc8235fa0, target=0x7fffe01f0580, this=0x7fffe01f0580) at ../../../../vlc/modules/gui/qt4/input_manager.cpp:182
#7  ItemChanged (p_this=<optimized out>, psz_var=<optimized out>, oldval=<optimized out>, newval=..., param= 0x7fffe01f0580) at ../../../../vlc/modules/gui/qt4/input_manager.cpp:301
#8  0x00007ffff796c2df in TriggerCallback (p_this=0x7cb6c8, p_var=0x7cb970, psz_name=0x7ffff7992856 "item-change", oldval=...) at ../../vlc/src/misc/variables.c:1361
#9  0x00007ffff796d206 in var_SetChecked (p_this=0x7cb6c8, psz_name=0x7ffff7992856 "item-change", expected_type=112, val=...) at ../../vlc/src/misc/variables.c:758
#10 0x00007ffff7908a8c in var_SetAddress (ptr=<optimized out>, psz_name=0x7ffff7992856 "item-change", p_obj=<optimized out>) at ../../vlc/include/vlc_variables.h:291
#11 input_item_changed (p_event=<optimized out>, user_data=<optimized out>) at ../../vlc/src/playlist/item.c:183
#12 0x00007ffff79682aa in vlc_event_send (p_em=0x7fffdc2d88d8, p_event=0x7fffecb89950) at ../../vlc/src/misc/events.c:237
#13 0x00007ffff7922ceb in input_SendEventMeta (p_input=0x7fffc823ec08) at ../../vlc/src/input/event.c:210
#14 0x00007ffff791e357 in EsOutMeta (p_meta=0x7fffc823e7b0, p_out=<optimized out>) at ../../vlc/src/input/es_out.c:1391
#15 EsOutControlLocked (args=<optimized out>, i_query=<optimized out>, out=<optimized out>) at ../../vlc/src/input/es_out.c:2442
#16 EsOutControl (out=<optimized out>, i_query=<optimized out>, args=<optimized out>) at ../../vlc/src/input/es_out.c:2682
#17 0x00007ffff791fd0c in es_out_vaControl (args=0x7fffecb89a68, i_query=<optimized out>, out=<optimized out>) at ../../vlc/include/vlc_es_out.h:126
#18 es_out_Control (out=<optimized out>, i_query=<optimized out>) at ../../vlc/include/vlc_es_out.h:135
#19 0x00007ffff7921dd2 in ControlLocked (args=<optimized out>, i_query=<optimized out>, p_out=<optimized out>) at ../../vlc/src/input/es_out_timeshift.c:620
#20 Control (p_out=<optimized out>, i_query=<optimized out>, args=<optimized out>) at ../../vlc/src/input/es_out_timeshift.c:718
#21 0x00007ffff79235cc in es_out_vaControl (args=0x7fffecb89bd8, i_query=<optimized out>, out=<optimized out>) at ../../vlc/include/vlc_es_out.h:126
#22 es_out_Control (out=<optimized out>, i_query=<optimized out>) at ../../vlc/include/vlc_es_out.h:135
#23 0x00007ffff79237ab in es_out_ControlSetMeta (p_meta=0x7fffc823e7b0, out=<optimized out>) at ../../vlc/include/vlc_es_out.h:147
#24 InputUpdateMeta (p_input=<optimized out>, p_meta=0x7fffc823e7b0) at ../../vlc/src/input/input.c:2877
#25 0x00007ffff7926583 in Init (p_input=0x7fffc823ec08) at ../../vlc/src/input/input.c:1302
#26 0x00007ffff7927c00 in input_Preparse (p_parent=<optimized out>, p_item=<optimized out>) at ../../vlc/src/input/input.c:200
#27 0x00007ffff7907045 in Preparse (p_item=0x7fffdc2d8850, obj=<optimized out>) at ../../vlc/src/playlist/preparser.c:137
#28 Thread (data=0x7d1c40) at ../../vlc/src/playlist/preparser.c:217
#29 0x00007ffff6de7f05 in start_thread () from /lib64/libpthread.so.0
#30 0x00007ffff692710d in clone () from /lib64/libc.so.6

-- 
Ilkka Ollakka
Whistler's Law:
	You never know who is right, but you always know who is in
charge.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20120822/5c668e0c/attachment.sig>


More information about the vlc-devel mailing list