Commit c92a7456 authored by Rafaël Carré's avatar Rafaël Carré

Prevents deadlocks with input in qt4

parent 82526952
...@@ -288,6 +288,7 @@ ExtraMetaPanel::ExtraMetaPanel( QWidget *parent, ...@@ -288,6 +288,7 @@ ExtraMetaPanel::ExtraMetaPanel( QWidget *parent,
**/ **/
void ExtraMetaPanel::update( input_item_t *p_item ) void ExtraMetaPanel::update( input_item_t *p_item )
{ {
vlc_mutex_lock( &p_item->lock );
vlc_meta_t *p_meta = p_item->p_meta; vlc_meta_t *p_meta = p_item->p_meta;
if( !p_meta ) if( !p_meta )
return; return;
...@@ -305,6 +306,7 @@ void ExtraMetaPanel::update( input_item_t *p_item ) ...@@ -305,6 +306,7 @@ void ExtraMetaPanel::update( input_item_t *p_item )
items.append( new QTreeWidgetItem ( extraMetaTree, tempItem ) ); items.append( new QTreeWidgetItem ( extraMetaTree, tempItem ) );
free( ppsz_allkey[i] ); free( ppsz_allkey[i] );
} }
vlc_mutex_unlock( &p_item->lock );
free( ppsz_allkey ); free( ppsz_allkey );
extraMetaTree->addTopLevelItems( items ); extraMetaTree->addTopLevelItems( items );
} }
......
...@@ -123,9 +123,7 @@ static int ItemChanged( vlc_object_t *p_this, const char *psz_var, ...@@ -123,9 +123,7 @@ static int ItemChanged( vlc_object_t *p_this, const char *psz_var,
void MediaInfoDialog::setInput( input_item_t *p_input ) void MediaInfoDialog::setInput( input_item_t *p_input )
{ {
clear(); clear();
vlc_mutex_lock( &p_input->lock );
update( p_input, true, true ); update( p_input, true, true );
vlc_mutex_unlock( &p_input->lock );
} }
void MediaInfoDialog::update() void MediaInfoDialog::update()
...@@ -144,12 +142,10 @@ void MediaInfoDialog::update() ...@@ -144,12 +142,10 @@ void MediaInfoDialog::update()
} }
vlc_object_yield( p_input ); vlc_object_yield( p_input );
vlc_mutex_lock( &input_GetItem(p_input)->lock );
update( input_GetItem(p_input), need_update, need_update ); update( input_GetItem(p_input), need_update, need_update );
need_update = false; need_update = false;
vlc_mutex_unlock( &input_GetItem(p_input)->lock );
vlc_object_release( p_input ); vlc_object_release( p_input );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment