[vlc-commits] aout: remove unused lock

Rémi Denis-Courmont git at videolan.org
Tue Jul 17 17:39:32 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Jul 17 18:39:07 2012 +0300| [42551ce30d2e322cb5eb3f155a622a0d7c0b253b] | committer: Rémi Denis-Courmont

aout: remove unused lock

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=42551ce30d2e322cb5eb3f155a622a0d7c0b253b
---

 src/audio_output/aout_internal.h |   36 ------------------------------------
 src/audio_output/common.c        |   38 --------------------------------------
 2 files changed, 74 deletions(-)

diff --git a/src/audio_output/aout_internal.h b/src/audio_output/aout_internal.h
index b7994de..463661f 100644
--- a/src/audio_output/aout_internal.h
+++ b/src/audio_output/aout_internal.h
@@ -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 )
 
diff --git a/src/audio_output/common.c b/src/audio_output/common.c
index 0c0a12d..f557fcb 100644
--- a/src/audio_output/common.c
+++ b/src/audio_output/common.c
@@ -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)
  */



More information about the vlc-commits mailing list