[vlc-devel] commit: Remove pl_Get. This endorsed unyielded playlist access. ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed May 7 20:37:29 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rem at videolan.org> | Wed May  7 21:38:43 2008 +0300| [d3d776685b767f1a4648d66e5ba00c495c69cb19]

Remove pl_Get. This endorsed unyielded playlist access.

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

 include/vlc_playlist.h          |    2 --
 src/input/input.c               |    6 +++---
 src/video_output/video_output.c |   32 +++++++++++++++-----------------
 3 files changed, 18 insertions(+), 22 deletions(-)

diff --git a/include/vlc_playlist.h b/include/vlc_playlist.h
index baa2217..e03027b 100644
--- a/include/vlc_playlist.h
+++ b/include/vlc_playlist.h
@@ -262,8 +262,6 @@ struct playlist_add_t
 #define PL_LOCK vlc_object_lock( p_playlist )
 #define PL_UNLOCK vlc_object_unlock( p_playlist )
 
-#define pl_Get( a ) a->p_libvlc->p_playlist
-
 VLC_EXPORT( playlist_t *, __pl_Yield, ( vlc_object_t * ) );
 #define pl_Yield( a ) __pl_Yield( VLC_OBJECT(a) )
 
diff --git a/src/input/input.c b/src/input/input.c
index fd9c4cf..f4a0e50 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -553,7 +553,7 @@ static int Run( input_thread_t *p_input )
 
         /* We have finished */
         p_input->b_eof = true;
-        playlist_Signal( pl_Get( p_input ) );
+        playlist_Signal( p_input->p_libvlc->p_playlist );
     }
 
     /* Wait until we are asked to die */
@@ -2110,7 +2110,7 @@ static int UpdateFromAccess( input_thread_t *p_input )
         vlc_meta_t *p_meta = vlc_meta_New();
         access_Control( p_input->p->input.p_access,ACCESS_GET_META, p_meta );
         InputUpdateMeta( p_input, p_meta );
-        var_SetInteger( pl_Get( p_input ), "item-change", p_input->p->input.p_item->i_id );
+        var_SetInteger( p_input->p_libvlc->p_playlist, "item-change", p_input->p->input.p_item->i_id );
         p_access->info.i_update &= ~INPUT_UPDATE_META;
     }
 
@@ -2153,7 +2153,7 @@ static void UpdateItemLength( input_thread_t *p_input, int64_t i_length )
     if( !p_input->b_preparsing )
     {
         pl_Yield( p_input );
-        var_SetInteger( pl_Get( p_input ), "item-change",
+        var_SetInteger( p_input->p_libvlc->p_playlist, "item-change",
                         p_input->p->input.p_item->i_id );
         pl_Release( p_input );
     }
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index b9516d2..78eef30 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -509,26 +509,24 @@ static void vout_Destructor( vlc_object_t * p_this )
 #ifndef __APPLE__
     vout_thread_t *p_another_vout;
 
-    playlist_t *p_playlist = pl_Get( p_vout );
-    if( p_playlist->b_die ) return;
-    vlc_object_yield( p_playlist );
-/* This is a dirty hack for mostly Linux, where there is no way to get the GUI
-   back if you closed it while playing video. This is solved in Mac OS X,
-   where we have this novelty called menubar, that will always allow you access
-   to the applications main functionality. They should try that on linux sometime */
-        p_another_vout = vlc_object_find( p_this->p_libvlc,
-                                          VLC_OBJECT_VOUT, FIND_ANYWHERE );
-        if( p_another_vout == NULL )
-        {
-            vlc_value_t val;
-            val.b_bool = true;
-            var_Set( p_playlist, "intf-show", val );
+    playlist_t *p_playlist = pl_Yield( p_vout );
+    if( p_playlist->b_die )
+    {
+        pl_Release( p_vout );
+        return;
     }
+    /* This is a dirty hack mostly for Linux, where there is no way to get the
+     * GUI back if you closed it while playing video. This is solved in
+     * Mac OS X, where we have this novelty called menubar, that will always
+     * allow you access to the applications main functionality. They should try
+     * that on linux sometime. */
+    p_another_vout = vlc_object_find( p_this->p_libvlc,
+                                      VLC_OBJECT_VOUT, FIND_ANYWHERE );
+    if( p_another_vout == NULL )
+        var_SetBool( p_playlist, "intf-show", true );
     else
-    {
         vlc_object_release( p_another_vout );
-    }
-    vlc_object_release( p_playlist );
+    pl_Release( p_vout );
 #endif
 }
 




More information about the vlc-devel mailing list