Changeset 82921f3c8dae23178b64089b22502bb8f528e7e6

Show
Ignore:
Timestamp:
05/07/08 21:26:56 (4 months ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1210188416 +0300
git-parent:

[3c74d129dd3d8a4bd11a4696f13af83103fe20fb]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1210188416 +0300
Message:

Remove p_playlist from p_libvlc

Plugins are already using pl_Yield to get the playlist, as they should.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/vlc_main.h

    rd6a7e48 r82921f3  
    11/***************************************************************************** 
    22 * main.h: access to all program variables 
    3  * Declaration and extern access to global program object. 
     3 * Declaration and extern access to LibVLC instance object. 
    44 ***************************************************************************** 
    5  * Copyright (C) 1999, 2000, 2001, 2002 the VideoLAN team 
    6  * $Id$ 
     5 * Copyright (C) 1999, 2000, 2001, 2002, 2008 the VideoLAN team 
    76 * 
    87 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    4140    char *                 psz_homedir;      ///< user's home directory 
    4241 
    43     playlist_t            *p_playlist;       ///< playlist object 
    44  
    4542    global_stats_t       *p_stats;           ///< Global statistics 
    4643 
  • include/vlc_playlist.h

    rd3d7766 r82921f3  
    413413 
    414414/** Tell the number of items in the current playing context */ 
    415 #define playlist_CurrentSize( obj ) obj->p_libvlc->p_playlist->current.i_size 
     415#define playlist_CurrentSize( pl ) pl->current.i_size 
    416416 
    417417/** Ask the playlist to do some work */ 
  • modules/gui/pda/pda_callbacks.c

    r449fd28 r82921f3  
    121121                                    0, name,   /* Add path to it !!! */ 
    122122                                    1, "no info", 
    123                                     2, playlist_CurrentSize(p_intf), /* Hidden index. */ 
     123                                    2, playlist_CurrentSize(p_playlist), /* Hidden index. */ 
    124124                                    -1 ); 
    125125 
     
    164164#endif 
    165165    vlc_mutex_lock( &p_playlist->object_lock ); 
    166     for( i_dummy = 0; i_dummy < playlist_CurrentSize(p_intf) ; i_dummy++ ) 
     166    for( i_dummy = 0; i_dummy < playlist_CurrentSize(p_playlist) ; i_dummy++ ) 
    167167    { 
    168168        playlist_item_t *p_item = playlist_ItemGetById( p_playlist, i_dummy, true ); 
     
    385385    { 
    386386        vlc_mutex_lock( &p_playlist->object_lock ); 
    387         if (playlist_CurrentSize(p_intf)) 
     387        if (playlist_CurrentSize(p_playlist)) 
    388388        { 
    389389            vlc_mutex_unlock( &p_playlist->object_lock ); 
     
    930930    } 
    931931 
    932     for(item = playlist_CurrentSize(p_intf) - 1; item >= 0 ;item-- ) 
     932    for(item = playlist_CurrentSize(p_playlist) - 1; item >= 0 ;item-- ) 
    933933    { 
    934934        msg_Err( p_playlist, "fix pda delete" ); 
  • src/control/media.c

    r449fd28 r82921f3  
    2323 
    2424#include "libvlc_internal.h" 
    25  
     25#include "libvlc.h" 
    2626#include <vlc/libvlc.h> 
    2727#include <vlc_input.h> 
     
    216216    { 
    217217        playlist_PreparseEnqueue( 
    218                 p_md->p_libvlc_instance->p_libvlc_int->p_playlist, 
     218                libvlc_priv (p_md->p_libvlc_instance->p_libvlc_int)->p_playlist, 
    219219                p_md->p_input_item ); 
    220220        p_md->b_preparsed = true; 
     
    431431    { 
    432432        playlist_AskForArtEnqueue( 
    433                 p_md->p_libvlc_instance->p_libvlc_int->p_playlist, 
     433                libvlc_priv(p_md->p_libvlc_instance->p_libvlc_int)->p_playlist, 
    434434                p_md->p_input_item ); 
    435435    } 
  • src/control/playlist.c

    r449fd28 r82921f3  
    3131#include "../playlist/playlist_internal.h" 
    3232 
    33 #define PL p_instance->p_libvlc_int->p_playlist 
     33#define PL (libvlc_priv (p_instance->p_libvlc_int)->p_playlist) 
    3434 
    3535static inline int playlist_was_locked( libvlc_instance_t *p_instance ) 
  • src/input/input.c

    rd3d7766 r82921f3  
    554554        /* We have finished */ 
    555555        p_input->b_eof = true; 
    556         playlist_Signal( p_input->p_libvlc->p_playlist ); 
     556        playlist_Signal( libvlc_priv (p_input->p_libvlc)->p_playlist ); 
    557557    } 
    558558 
     
    21112111        access_Control( p_input->p->input.p_access,ACCESS_GET_META, p_meta ); 
    21122112        InputUpdateMeta( p_input, p_meta ); 
    2113         var_SetInteger( p_input->p_libvlc->p_playlist, "item-change", p_input->p->input.p_item->i_id ); 
     2113        var_SetInteger( libvlc_priv (p_input->p_libvlc)->p_playlist, 
     2114                        "item-change", p_input->p->input.p_item->i_id ); 
    21142115        p_access->info.i_update &= ~INPUT_UPDATE_META; 
    21152116    } 
     
    21542155    { 
    21552156        pl_Yield( p_input ); 
    2156         var_SetInteger( p_input->p_libvlc->p_playlist, "item-change"
    2157                         p_input->p->input.p_item->i_id ); 
     2157        var_SetInteger( libvlc_priv (p_input->p_libvlc)->p_playlist
     2158                        "item-change", p_input->p->input.p_item->i_id ); 
    21582159        pl_Release( p_input ); 
    21592160    } 
  • src/libvlc-common.c

    rb16fe48 r82921f3  
    180180 
    181181    priv = libvlc_priv (p_libvlc); 
    182     p_libvlc->p_playlist = NULL; 
     182    priv->p_playlist = NULL; 
    183183    priv->p_interaction = NULL; 
    184184    priv->p_vlm = NULL; 
     
    737737    /* Initialize playlist and get commandline files */ 
    738738    playlist_ThreadCreate( p_libvlc ); 
    739     if( !p_libvlc->p_playlist ) 
     739    if( !priv->p_playlist ) 
    740740    { 
    741741        msg_Err( p_libvlc, "playlist initialization failed" ); 
     
    747747        return VLC_EGENERIC; 
    748748    } 
    749     p_playlist = p_libvlc->p_playlist; 
     749    p_playlist = priv->p_playlist; 
    750750 
    751751    psz_modules = config_GetPsz( p_playlist, "services-discovery" ); 
     
    940940    /* Free playlist */ 
    941941    msg_Dbg( p_libvlc, "removing playlist" ); 
    942     playlist_ThreadDestroy( p_libvlc->p_playlist ); 
     942    playlist_ThreadDestroy( priv->p_playlist ); 
    943943 
    944944    /* Free video outputs */ 
     
    11391139    /* Interface doesn't handle play on start so do it ourselves */ 
    11401140    if( !p_intf->b_play && b_play ) 
    1141         playlist_Play( p_libvlc->p_playlist ); 
     1141        playlist_Play( libvlc_priv(p_libvlc)->p_playlist ); 
    11421142 
    11431143    /* Try to run the interface */ 
  • src/libvlc.c

    r449fd28 r82921f3  
    297297#define LIBVLC_PLAYLIST_FUNC \ 
    298298    libvlc_int_t *p_libvlc = vlc_current_object( i_object );\ 
    299     if( !p_libvlc || !p_libvlc->p_playlist ) return VLC_ENOOBJ; \ 
    300     vlc_object_yield( p_libvlc->p_playlist ); 
     299    if( !p_libvlc ) return VLC_ENOOBJ; \ 
     300    playlist_t *p_playlist = pl_Yield( p_libvlc ); \ 
     301    if( !p_playlist ) return VLC_ENOOBJ 
    301302 
    302303#define LIBVLC_PLAYLIST_FUNC_END \ 
    303     vlc_object_release( p_libvlc->p_playlist ); \ 
     304    pl_Release( p_libvlc ); \ 
    304305    if( i_object ) vlc_object_release( p_libvlc ); 
    305306 
     
    316317    int i_err; 
    317318    LIBVLC_PLAYLIST_FUNC; 
    318     i_err = playlist_AddExt( p_libvlc->p_playlist, psz_target, 
     319    i_err = playlist_AddExt( p_playlist, psz_target, 
    319320                             NULL,  i_mode, i_pos, -1, 
    320321                             ppsz_options, i_options, true, false ); 
     
    329330{ 
    330331    LIBVLC_PLAYLIST_FUNC; 
    331     playlist_Play( p_libvlc->p_playlist ); 
     332    playlist_Play( p_playlist ); 
    332333    LIBVLC_PLAYLIST_FUNC_END; 
    333334    return VLC_SUCCESS; 
     
    340341{ 
    341342    LIBVLC_PLAYLIST_FUNC; 
    342     playlist_Pause( p_libvlc->p_playlist ); 
     343    playlist_Pause( p_playlist ); 
    343344    LIBVLC_PLAYLIST_FUNC_END; 
    344345    return VLC_SUCCESS; 
     
    351352{ 
    352353    LIBVLC_PLAYLIST_FUNC; 
    353     playlist_Stop( p_libvlc->p_playlist ); 
     354    playlist_Stop( p_playlist ); 
    354355    LIBVLC_PLAYLIST_FUNC_END; 
    355356    return VLC_SUCCESS; 
     
    364365 
    365366    LIBVLC_PLAYLIST_FUNC; 
    366     if( p_libvlc->p_playlist->p_input ) 
     367    if( p_playlist->p_input ) 
    367368    { 
    368369        vlc_value_t  val; 
    369         var_Get( p_libvlc->p_playlist->p_input, "state", &val ); 
     370        var_Get( p_playlist->p_input, "state", &val ); 
    370371        b_playing = ( val.i_int == PLAYING_S ); 
    371372    } 
    372373    else 
    373374    { 
    374         b_playing = playlist_IsPlaying( p_libvlc->p_playlist ); 
     375        b_playing = playlist_IsPlaying( p_playlist ); 
    375376    } 
    376377    LIBVLC_PLAYLIST_FUNC_END; 
     
    673674    int i_size; 
    674675    LIBVLC_PLAYLIST_FUNC; 
    675     i_size = p_libvlc->p_playlist->items.i_size; 
     676    i_size = p_playlist->items.i_size; 
    676677    LIBVLC_PLAYLIST_FUNC_END; 
    677678    return i_size; 
     
    686687{ 
    687688    LIBVLC_PLAYLIST_FUNC; 
    688     playlist_Next( p_libvlc->p_playlist ); 
     689    playlist_Next( p_playlist ); 
    689690    LIBVLC_PLAYLIST_FUNC_END; 
    690691    return VLC_SUCCESS; 
     
    699700{ 
    700701    LIBVLC_PLAYLIST_FUNC; 
    701     playlist_Prev( p_libvlc->p_playlist ); 
     702    playlist_Prev( p_playlist ); 
    702703    LIBVLC_PLAYLIST_FUNC_END; 
    703704    return VLC_SUCCESS; 
     
    710711{ 
    711712    LIBVLC_PLAYLIST_FUNC; 
    712     playlist_Clear( p_libvlc->p_playlist, true ); 
     713    playlist_Clear( p_playlist, true ); 
    713714    LIBVLC_PLAYLIST_FUNC_END; 
    714715    return VLC_SUCCESS; 
  • src/libvlc.h

    r6dad9cd r82921f3  
    233233 
    234234    module_t          *p_memcpy_module;  ///< Fast memcpy plugin used 
    235     vlm_t             *p_vlm;  ///< VLM if created from libvlc-common.c 
     235    playlist_t        *p_playlist; //< the playlist singleton 
     236    vlm_t             *p_vlm;  ///< the VLM singleton (or NULL) 
    236237    vlc_object_t      *p_interaction;    ///< interface interaction object 
    237238    httpd_t           *p_httpd; ///< HTTP daemon (src/network/httpd.c) 
  • src/misc/win32_specific.c

    rb8a4cd3 r82921f3  
    315315 
    316316        /* Add files to the playlist */ 
    317         p_playlist = (playlist_t *)vlc_object_find( p_this, 
    318                                                     VLC_OBJECT_PLAYLIST, 
    319                                                     FIND_ANYWHERE ); 
     317        p_playlist = pl_Yield( p_this ); 
    320318        if( !p_playlist ) return 0; 
    321319 
  • src/playlist/control.c

    r82a358a r82921f3  
    4444playlist_t *__pl_Yield( vlc_object_t *p_this ) 
    4545{ 
    46     playlist_t *pl = p_this->p_libvlc->p_playlist; 
     46    playlist_t *pl = libvlc_priv (p_this->p_libvlc)->p_playlist; 
    4747    assert( pl != NULL ); 
    4848    vlc_object_yield( pl ); 
     
    5252void __pl_Release( vlc_object_t *p_this ) 
    5353{ 
    54     playlist_t *pl = p_this->p_libvlc->p_playlist; 
     54    playlist_t *pl = libvlc_priv (p_this->p_libvlc)->p_playlist; 
    5555    assert( pl != NULL ); 
    5656    vlc_object_release( pl ); 
  • src/playlist/engine.c

    r82a358a r82921f3  
    7575    TAB_INIT( p_playlist->i_sds, p_playlist->pp_sds ); 
    7676 
    77     p_parent->p_libvlc->p_playlist = p_playlist; 
     77    libvlc_priv(p_parent->p_libvlc)->p_playlist = p_playlist; 
    7878 
    7979    VariablesInit( p_playlist );