Commit 42551ce3 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

aout: remove unused lock

parent 5e36262a
......@@ -90,7 +90,6 @@ typedef struct
struct
{
vlc_mutex_t lock;
float amp; /**< Software volume amplification */
bool mute; /**< Software mute */
struct audio_mixer *mixer; /**< Software volume plugin */
......@@ -200,51 +199,16 @@ void aout_RequestRestart(audio_output_t *);
void aout_Shutdown (audio_output_t *);
/* Audio output locking */
#if !defined (NDEBUG) \
&& defined __linux__ && (defined (__i386__) || defined (__x86_64__))
# define AOUT_DEBUG 1
#endif
#ifdef AOUT_DEBUG
enum
{
OUTPUT_LOCK=1,
VOLUME_LOCK=2,
};
void aout_lock_check (unsigned);
void aout_unlock_check (unsigned);
#else
# define aout_lock_check( i ) (void)0
# define aout_unlock_check( i ) (void)0
#endif
static inline void aout_lock( audio_output_t *p_aout )
{
aout_lock_check( OUTPUT_LOCK );
vlc_mutex_lock( &aout_owner(p_aout)->lock );
}
static inline void aout_unlock( audio_output_t *p_aout )
{
aout_unlock_check( OUTPUT_LOCK );
vlc_mutex_unlock( &aout_owner(p_aout)->lock );
}
static inline void aout_lock_volume( audio_output_t *p_aout )
{
aout_lock_check( VOLUME_LOCK );
vlc_mutex_lock( &aout_owner(p_aout)->volume.lock );
}
static inline void aout_unlock_volume( audio_output_t *p_aout )
{
aout_unlock_check( VOLUME_LOCK );
vlc_mutex_unlock( &aout_owner(p_aout)->volume.lock );
}
#define aout_assert_locked( aout ) \
vlc_assert_locked( &aout_owner(aout)->lock )
......
......@@ -61,7 +61,6 @@ audio_output_t *aout_New( vlc_object_t * p_parent )
vlc_mutex_init (&owner->lock);
owner->module = NULL;
owner->input = NULL;
vlc_mutex_init (&owner->volume.lock);
owner->volume.amp = 1.f;
owner->volume.mute = false;
owner->volume.mixer = NULL;
......@@ -196,46 +195,9 @@ static void aout_Destructor (vlc_object_t *obj)
audio_output_t *aout = (audio_output_t *)obj;
aout_owner_t *owner = aout_owner (aout);
vlc_mutex_destroy (&owner->volume.lock);
vlc_mutex_destroy (&owner->lock);
}
#ifdef AOUT_DEBUG
/* Lock debugging */
static __thread unsigned aout_locks = 0;
void aout_lock_check (unsigned i)
{
unsigned allowed;
switch (i)
{
case VOLUME_LOCK:
allowed = 0;
break;
case OUTPUT_LOCK:
allowed = VOLUME_LOCK;
break;
default:
abort ();
}
if (aout_locks & ~allowed)
{
fprintf (stderr, "Illegal audio lock transition (%x -> %x)\n",
aout_locks, aout_locks|i);
vlc_backtrace ();
abort ();
}
aout_locks |= i;
}
void aout_unlock_check (unsigned i)
{
assert (aout_locks & i);
aout_locks &= ~i;
}
#endif
/*
* Formats management (internal and external)
*/
......
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