]> git.sesse.net Git - vlc/commitdiff
Remove the last direct use of object_wait
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Tue, 17 Jun 2008 18:43:32 +0000 (21:43 +0300)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Tue, 17 Jun 2008 18:43:32 +0000 (21:43 +0300)
src/libvlc.h
src/playlist/control.c
src/playlist/item.c
src/playlist/search.c
src/video_output/vout_intf.c

index 0964abdf278af655ca08acb88759ef8c4832fec1..c42058edc7a0904b7a2e1d345fd3555f978ce0ef 100644 (file)
@@ -142,6 +142,16 @@ extern void *
 vlc_custom_create (vlc_object_t *p_this, size_t i_size, int i_type,
                    const char *psz_type);
 
+/* Signal an object without checking for locking consistency. This is wrong. */
+#ifdef __GNUC__
+__attribute__((deprecated))
+#endif
+static inline void
+vlc_object_signal_maybe (vlc_object_t *p_this)
+{
+    vlc_cond_signal (&p_this->object_wait);
+}
+
 /**
  * libvlc_global_data_t (global variable)
  *
index 41bbf5f696d2bc571ac0a1f26c5c2c774512a944..8051f51f3780e1fdf34dca5a260b325ba854fc8d 100644 (file)
@@ -162,7 +162,7 @@ static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args
         return VLC_EBADVAR;
         break;
     }
-    vlc_cond_signal( &p_playlist->object_wait );
+    vlc_object_signal_maybe( VLC_OBJECT(p_playlist) );
 
     return VLC_SUCCESS;
 }
index b3c79dd0315a7c27d7aa2bf037c10c7d9a2ba827..20ee6f2e9b4309319b5578cfbbb3541e954b222b 100644 (file)
@@ -724,7 +724,7 @@ int playlist_TreeMove( playlist_t * p_playlist, playlist_item_t *p_item,
     else
         i_ret = TreeMove( p_playlist, p_item, p_node, i_newpos );
     p_playlist->b_reset_currently_playing = true;
-    vlc_cond_signal( &p_playlist->object_wait );
+    vlc_object_signal_maybe( VLC_OBJECT(p_playlist) );
     return i_ret;
 }
 
@@ -750,7 +750,7 @@ void playlist_SendAddNotify( playlist_t *p_playlist, int i_item_id,
     val.p_address = p_add;
     p_playlist->b_reset_currently_playing = true;
     if( b_signal )
-        vlc_cond_signal( &p_playlist->object_wait );
+        vlc_object_signal_maybe( p_playlist );
     var_Set( p_playlist, "item-append", val );
     free( p_add );
 }
@@ -808,7 +808,7 @@ static void GoAndPreparse( playlist_t *p_playlist, int i_mode,
         if( p_playlist->p_input )
             input_StopThread( p_playlist->p_input );
         p_playlist->request.i_status = PLAYLIST_RUNNING;
-        vlc_cond_signal( &p_playlist->object_wait );
+        vlc_object_signal_maybe( VLC_OBJECT(p_playlist) );
     }
     /* Preparse if PREPARSE or SPREPARSE & not enough meta */
     char *psz_artist = input_item_GetArtist( p_item_cat->p_input );
@@ -890,7 +890,7 @@ static int DeleteInner( playlist_t * p_playlist, playlist_item_t *p_item,
             p_playlist->request.b_request = true;
             p_playlist->request.p_item = NULL;
             msg_Info( p_playlist, "stopping playback" );
-            vlc_cond_signal( &p_playlist->object_wait );
+            vlc_object_signal_maybe( VLC_OBJECT(p_playlist) );
         }
         b_delay_deletion = true;
     }
index 207205d4aa93ed7504ec1a65228c6db9227b70d3..0cd55cadd3e9453959cada003d3bf2eb70761f35 100644 (file)
@@ -167,6 +167,6 @@ int playlist_LiveSearchUpdate( playlist_t *p_playlist, playlist_item_t *p_root,
 {
     p_playlist->b_reset_currently_playing = true;
     playlist_LiveSearchUpdateInternal( p_playlist, p_root, psz_string );
-    vlc_cond_signal( &p_playlist->object_wait );
+    vlc_object_signal_maybe( VLC_OBJECT(p_playlist) );
     return VLC_SUCCESS;
 }
index b3dbe13ac350459e0deff24a0affc91cf357d821..2457bbd14c79cc1a58a28dc7b6b3cb894d9d5a3f 100644 (file)
@@ -544,7 +544,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
         {
             msg_Err( p_vout, "Could not get snapshot" );
             image_HandlerDelete( p_image );
-            vlc_cond_signal( &p_dest->object_wait );
+            vlc_object_signal_maybe( VLC_OBJECT(p_dest) );
             vlc_object_release( p_dest );
             return VLC_EGENERIC;
         }
@@ -556,7 +556,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
         {
             block_Release( p_block );
             image_HandlerDelete( p_image );
-            vlc_cond_signal( &p_dest->object_wait );
+            vlc_object_signal_maybe( VLC_OBJECT(p_dest) );
             vlc_object_release( p_dest );
             return VLC_ENOMEM;
         }
@@ -573,7 +573,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
             block_Release( p_block );
             free( p_snapshot );
             image_HandlerDelete( p_image );
-            vlc_cond_signal( &p_dest->object_wait );
+            vlc_object_signal_maybe( VLC_OBJECT(p_dest) );
             vlc_object_release( p_dest );
             return VLC_ENOMEM;
         }
@@ -584,7 +584,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
         block_Release( p_block );
 
         /* Unlock the object */
-        vlc_cond_signal( &p_dest->object_wait );
+        vlc_object_signal_maybe( VLC_OBJECT(p_dest) );
         vlc_object_release( p_dest );
 
         image_HandlerDelete( p_image );