Commit 2764c076 authored by Rafaël Carré's avatar Rafaël Carré

taglib is not thread-safe

Fix ticket #3958
(cherry picked from commit 8675d26cea713ca9ebae3b91bd7c3e9bb320dcb1)
Signed-off-by: default avatarRafaël Carré <rafael.carre@gmail.com>
parent 53db3edd
...@@ -76,6 +76,8 @@ ...@@ -76,6 +76,8 @@
#include <textidentificationframe.h> #include <textidentificationframe.h>
#include <uniquefileidentifierframe.h> #include <uniquefileidentifierframe.h>
// taglib is not thread safe
static vlc_mutex_t taglib_lock = VLC_STATIC_MUTEX;
// Local functions // Local functions
static int ReadMeta ( vlc_object_t * ); static int ReadMeta ( vlc_object_t * );
...@@ -359,6 +361,7 @@ static void ReadMetaFromMP4( MP4::Tag* tag, demux_t *p_demux, demux_meta_t *p_de ...@@ -359,6 +361,7 @@ static void ReadMetaFromMP4( MP4::Tag* tag, demux_t *p_demux, demux_meta_t *p_de
*/ */
static int ReadMeta( vlc_object_t* p_this) 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_meta_t* p_demux_meta = (demux_meta_t *)p_this;
demux_t* p_demux = p_demux_meta->p_demux; demux_t* p_demux = p_demux_meta->p_demux;
vlc_meta_t* p_meta; vlc_meta_t* p_meta;
...@@ -569,6 +572,7 @@ static void WriteMetaToXiph( Ogg::XiphComment* tag, input_item_t* p_item ) ...@@ -569,6 +572,7 @@ static void WriteMetaToXiph( Ogg::XiphComment* tag, input_item_t* p_item )
static int WriteMeta( vlc_object_t *p_this ) static int WriteMeta( vlc_object_t *p_this )
{ {
vlc_mutex_locker locker (&taglib_lock);
meta_export_t *p_export = (meta_export_t *)p_this; meta_export_t *p_export = (meta_export_t *)p_this;
input_item_t *p_item = p_export->p_item; input_item_t *p_item = p_export->p_item;
FileRef f; FileRef f;
......
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