From: Rafaël Carré Date: Sun, 24 Oct 2010 16:14:33 +0000 (+0200) Subject: taglib is not thread-safe X-Git-Url: http://git.videolan.org/?p=vlc.git;a=commitdiff_plain;h=8675d26cea713ca9ebae3b91bd7c3e9bb320dcb1;hp=2ad5d811df1fcb2c0229d9e21fdd93d43344d19c taglib is not thread-safe Fix ticket #3958 --- diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp index 33866d0..f67dbda 100644 --- a/modules/meta_engine/taglib.cpp +++ b/modules/meta_engine/taglib.cpp @@ -77,6 +77,8 @@ #include #include +// taglib is not thread safe +static vlc_mutex_t taglib_lock = VLC_STATIC_MUTEX; // Local functions static int ReadMeta ( vlc_object_t * ); @@ -363,6 +365,7 @@ static void ReadMetaFromMP4( MP4::Tag* tag, demux_t *p_demux, demux_meta_t *p_de */ static int ReadMeta( vlc_object_t* p_this) { + vlc_mutex_locker locker (&taglib_lock); demux_meta_t* p_demux_meta = (demux_meta_t *)p_this; demux_t* p_demux = p_demux_meta->p_demux; vlc_meta_t* p_meta; @@ -585,6 +588,7 @@ static void WriteMetaToXiph( Ogg::XiphComment* tag, input_item_t* p_item ) static int WriteMeta( vlc_object_t *p_this ) { + vlc_mutex_locker locker (&taglib_lock); meta_export_t *p_export = (meta_export_t *)p_this; input_item_t *p_item = p_export->p_item; FileRef f;