[vlc-devel] commit: playlist: Listen to duration changed events, and remove a vout-> playlist dependency. (Pierre d'Herbemont )

git version control git at videolan.org
Sun Jun 1 21:47:20 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Sun Jun  1 21:47:49 2008 +0200| [61ee17a85417817e8046fe5373f160f5349cbf07]

playlist: Listen to duration changed events, and remove a vout->playlist dependency.

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

 src/input/input.c   |    8 --------
 src/playlist/item.c |   14 +++++++++++---
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index 4ab5b55..9914457 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -2162,14 +2162,6 @@ static int UpdateFromAccess( input_thread_t *p_input )
 static void UpdateItemLength( input_thread_t *p_input, int64_t i_length )
 {
     input_item_SetDuration( p_input->p->input.p_item, (mtime_t) i_length );
-
-    if( !p_input->b_preparsing )
-    {
-        pl_Yield( p_input );
-        var_SetInteger( libvlc_priv (p_input->p_libvlc)->p_playlist,
-                        "item-change", p_input->p->input.p_item->i_id );
-        pl_Release( p_input );
-    }
 }
 
 /*****************************************************************************
diff --git a/src/playlist/item.c b/src/playlist/item.c
index c2bc35c..1dee00b 100644
--- a/src/playlist/item.c
+++ b/src/playlist/item.c
@@ -107,10 +107,10 @@ static void input_item_subitem_added( const vlc_event_t * p_event,
 }
 
 /*****************************************************************************
- * An input item's meta has changed (Event Callback)
+ * An input item's meta or duration has changed (Event Callback)
  *****************************************************************************/
-static void input_item_meta_changed( const vlc_event_t * p_event,
-                                      void * user_data )
+static void input_item_changed( const vlc_event_t * p_event,
+                                void * user_data )
 {
     playlist_item_t * p_item = user_data;
     var_SetInteger( p_item->p_playlist,
@@ -127,6 +127,10 @@ static void install_input_item_observer( playlist_item_t * p_item )
                       input_item_subitem_added,
                       p_item );
     vlc_event_attach( &p_item->p_input->event_manager,
+                      vlc_InputItemDurationChanged,
+                      input_item_meta_changed,
+                      p_item );
+    vlc_event_attach( &p_item->p_input->event_manager,
                       vlc_InputItemMetaChanged,
                       input_item_meta_changed,
                       p_item );
@@ -139,6 +143,10 @@ static void uninstall_input_item_observer( playlist_item_t * p_item )
                       input_item_meta_changed,
                       p_item );
     vlc_event_detach( &p_item->p_input->event_manager,
+                      vlc_InputItemDurationChanged,
+                      input_item_meta_changed,
+                      p_item );
+    vlc_event_detach( &p_item->p_input->event_manager,
                       vlc_InputItemSubItemAdded,
                       input_item_subitem_added,
                       p_item );




More information about the vlc-devel mailing list