# HG changeset patch # User Matti Hamalainen # Date 1188687966 -10800 # Node ID c3b8dedeedc5c5963e3bf75cf7400a24e48ed07b # Parent f7c630358bda4e1451322c3ba4b659354da0a891 Some Audacious specific (for Tuple generation) mutex locks added. diff -r f7c630358bda -r c3b8dedeedc5 src/sid/xmms-sid.c --- a/src/sid/xmms-sid.c Sun Sep 02 01:31:55 2007 +0300 +++ b/src/sid/xmms-sid.c Sun Sep 02 02:06:06 2007 +0300 @@ -298,10 +298,18 @@ } -static gboolean xs_schedule_subctrl_update( gpointer unused ) +static gboolean xs_schedule_subctrl_update(gpointer unused) { - if (xs_status.isPlaying == TRUE ) + (void) unused; + gboolean isPlaying; + + XS_MUTEX_LOCK(xs_status); + isPlaying = xs_status.isPlaying; + XS_MUTEX_UNLOCK(xs_status); + + if (isPlaying) xs_subctrl_update(); + return FALSE; } @@ -964,10 +972,14 @@ t_xs_tuneinfo *pInfo; t_xs_tuple *pResult = NULL; + XS_MUTEX_LOCK(xs_status); + /* Get tune information from emulation engine */ pInfo = xs_status.sidPlayer->plrGetSIDInfo(songFilename); - if (!pInfo) + if (!pInfo) { + XS_MUTEX_UNLOCK(xs_status); return NULL; + } /* Get sub-tune information, if available */ if ((pInfo->startTune > 0) && (pInfo->startTune <= pInfo->nsubTunes)) { @@ -992,6 +1004,8 @@ /* Free tune information */ xs_tuneinfo_free(pInfo); + XS_MUTEX_UNLOCK(xs_status); + return pResult; }