[vlc-devel] [PATCH] Playlists, Dbus

Laurent Aimar fenrir at via.ecp.fr
Fri Nov 21 08:12:20 CET 2008


Hi,

On Fri, Nov 21, 2008, Laurent Aimar wrote:
> On Thu, Nov 20, 2008, Polar Humenn wrote:
> > diff --git a/src/playlist/control.c b/src/playlist/control.c
> > index 5930b77..7cd1c46 100644
> > --- a/src/playlist/control.c
> > +++ b/src/playlist/control.c
> > @@ -132,7 +132,9 @@ static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args
> >          if( pl_priv(p_playlist)->p_input )
> >          {
> >              val.i_int = PLAYING_S;
> > +            PL_UNLOCK;
> >              var_Set( pl_priv(p_playlist)->p_input, "state", val );
> > +            PL_LOCK;
> >              break;
> >          }
> >          else
> > @@ -156,7 +158,9 @@ static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args
> >              if( pl_priv(p_playlist)->p_input )
> >              {
> >                  val.i_int = PLAYING_S;
> > +                PL_UNLOCK;
> >                  var_Set( pl_priv(p_playlist)->p_input, "state", val );
> > +                PL_LOCK;
> >              }
> >          }
> >          else
> > @@ -165,7 +169,9 @@ static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args
> >              if( pl_priv(p_playlist)->p_input )
> >              {
> >                  val.i_int = PAUSE_S;
> > +                PL_UNLOCK;
> >                  var_Set( pl_priv(p_playlist)->p_input, "state", val );
> > +                PL_LOCK;
> >              }
> >          }
> >          break;
> > @@ -517,10 +523,12 @@ int playlist_PlayItem( playlist_t *p_playlist, playlist_item_t *p_item )
> >      set_current_status_item( p_playlist, p_item );
> >  
> >      pl_priv(p_playlist)->status.i_status = PLAYLIST_RUNNING;
> > -
> > +    
> > +    PL_UNLOCK;
> >      var_SetInteger( p_playlist, "activity", i_activity +
> >                      DEFAULT_INPUT_ACTIVITY );
> > -
> > +    PL_LOCK;
> > +    
>  I really fear that they will create race conditions. You allow someone to lock
> the playlist in the middle of a command...
> 
>  Is the playlist deadlocking itself or a module ?
 Answering myself, the playlist itself will not deadlock as it does not add 
callbacks on them.

 So why can't you fix the problem inside the module code ?

-- 
fenrir




More information about the vlc-devel mailing list