]> git.sesse.net Git - vlc/blobdiff - src/playlist/control.c
Merge branch 'master' into lpcm_encoder
[vlc] / src / playlist / control.c
index 3ee0f5e06b727aaf8fe52d19b3b2c183fb858c46..c2f8171f0f073ec1d9404d6d9b9c196652db91fa 100644 (file)
@@ -41,8 +41,8 @@ static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args
 
 static vlc_mutex_t global_lock = VLC_STATIC_MUTEX;
 
-#undef pl_Hold
-playlist_t *pl_Hold (vlc_object_t *obj)
+#undef pl_Get
+playlist_t *pl_Get (vlc_object_t *obj)
 {
     playlist_t *pl;
     libvlc_int_t *p_libvlc = obj->p_libvlc;
@@ -56,28 +56,10 @@ playlist_t *pl_Hold (vlc_object_t *obj)
          playlist_Activate (pl);
          libvlc_priv (p_libvlc)->playlist_active = true;
     }
-
-    /* The playlist should hold itself with vlc_object_hold() if ever. */
-    assert (VLC_OBJECT (pl) != obj);
-    if (pl)
-        vlc_object_hold (pl);
     vlc_mutex_unlock (&global_lock);
     return pl;
 }
 
-#undef pl_Release
-void pl_Release( vlc_object_t *p_this )
-{
-    playlist_t *pl = libvlc_priv (p_this->p_libvlc)->p_playlist;
-    assert( pl != NULL );
-
-    /* The rule is that pl_Release() should act on
-       the same object than pl_Hold() */
-    assert( VLC_OBJECT(pl) != p_this);
-
-    vlc_object_release( pl );
-}
-
 void pl_Deactivate (libvlc_int_t *p_libvlc)
 {
     bool deactivate;
@@ -176,9 +158,10 @@ static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args
 
     case PLAYLIST_PAUSE:
         if( !pl_priv(p_playlist)->p_input )
-        {    /* FIXME: is this really useful without input? */
-             pl_priv(p_playlist)->status.i_status = PLAYLIST_PAUSED;
-             break;
+        {   /* FIXME: is this really useful without input? */
+            pl_priv(p_playlist)->status.i_status = PLAYLIST_PAUSED;
+            /* return without notifying the playlist thread as there is nothing to do */
+            return VLC_SUCCESS;
         }
 
         if( var_GetInteger( pl_priv(p_playlist)->p_input, "state" ) == PAUSE_S )
@@ -216,28 +199,22 @@ static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args
  * Preparse control
  *****************************************************************************/
 /** Enqueue an item for preparsing */
-int playlist_PreparseEnqueue( playlist_t *p_playlist,
-                              input_item_t *p_item, bool b_locked )
+int playlist_PreparseEnqueue( playlist_t *p_playlist, input_item_t *p_item )
 {
     playlist_private_t *p_sys = pl_priv(p_playlist);
 
-    PL_LOCK_IF( !b_locked );
     if( p_sys->p_preparser )
         playlist_preparser_Push( p_sys->p_preparser, p_item );
-    PL_UNLOCK_IF( !b_locked );
 
     return VLC_SUCCESS;
 }
 
-int playlist_AskForArtEnqueue( playlist_t *p_playlist,
-                               input_item_t *p_item, bool b_locked )
+int playlist_AskForArtEnqueue( playlist_t *p_playlist, input_item_t *p_item )
 {
     playlist_private_t *p_sys = pl_priv(p_playlist);
 
-    PL_LOCK_IF( !b_locked );
     if( p_sys->p_fetcher )
         playlist_fetcher_Push( p_sys->p_fetcher, p_item );
-    PL_UNLOCK_IF( !b_locked );
 
     return VLC_SUCCESS;
 }