Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
82921f3c
Commit
82921f3c
authored
May 07, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove p_playlist from p_libvlc
Plugins are already using pl_Yield to get the playlist, as they should.
parent
3c74d129
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
42 additions
and
44 deletions
+42
-44
include/vlc_main.h
include/vlc_main.h
+2
-5
include/vlc_playlist.h
include/vlc_playlist.h
+1
-1
modules/gui/pda/pda_callbacks.c
modules/gui/pda/pda_callbacks.c
+4
-4
src/control/media.c
src/control/media.c
+3
-3
src/control/playlist.c
src/control/playlist.c
+1
-1
src/input/input.c
src/input/input.c
+5
-4
src/libvlc-common.c
src/libvlc-common.c
+5
-5
src/libvlc.c
src/libvlc.c
+15
-14
src/libvlc.h
src/libvlc.h
+2
-1
src/misc/win32_specific.c
src/misc/win32_specific.c
+1
-3
src/playlist/control.c
src/playlist/control.c
+2
-2
src/playlist/engine.c
src/playlist/engine.c
+1
-1
No files found.
include/vlc_main.h
View file @
82921f3c
/*****************************************************************************
* main.h: access to all program variables
* Declaration and extern access to
global program
object.
* Declaration and extern access to
LibVLC instance
object.
*****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 the VideoLAN team
* $Id$
* Copyright (C) 1999, 2000, 2001, 2002, 2008 the VideoLAN team
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
...
...
@@ -40,8 +39,6 @@ struct libvlc_int_t
/* Global properties */
char
*
psz_homedir
;
///< user's home directory
playlist_t
*
p_playlist
;
///< playlist object
global_stats_t
*
p_stats
;
///< Global statistics
...
...
include/vlc_playlist.h
View file @
82921f3c
...
...
@@ -412,7 +412,7 @@ static inline int playlist_Import( playlist_t *p_playlist, const char *psz_file)
#define playlist_IsEmpty( pl ) ( pl->items.i_size == 0 )
/** Tell the number of items in the current playing context */
#define playlist_CurrentSize(
obj ) obj->p_libvlc->p_playlist
->current.i_size
#define playlist_CurrentSize(
pl ) pl
->current.i_size
/** Ask the playlist to do some work */
#define playlist_Signal( p_playlist ) vlc_object_signal( p_playlist )
...
...
modules/gui/pda/pda_callbacks.c
View file @
82921f3c
...
...
@@ -120,7 +120,7 @@ static void PlaylistAddItem(GtkWidget *widget, gchar *name, char **ppsz_options,
gtk_list_store_set
(
GTK_LIST_STORE
(
p_play_model
),
&
p_play_iter
,
0
,
name
,
/* Add path to it !!! */
1
,
"no info"
,
2
,
playlist_CurrentSize
(
p_
intf
),
/* Hidden index. */
2
,
playlist_CurrentSize
(
p_
playlist
),
/* Hidden index. */
-
1
);
/* Add to VLC's playlist */
...
...
@@ -163,7 +163,7 @@ void PlaylistRebuildListStore( intf_thread_t *p_intf,
red.green = 0;
#endif
vlc_mutex_lock
(
&
p_playlist
->
object_lock
);
for
(
i_dummy
=
0
;
i_dummy
<
playlist_CurrentSize
(
p_
intf
)
;
i_dummy
++
)
for
(
i_dummy
=
0
;
i_dummy
<
playlist_CurrentSize
(
p_
playlist
)
;
i_dummy
++
)
{
playlist_item_t
*
p_item
=
playlist_ItemGetById
(
p_playlist
,
i_dummy
,
true
);
if
(
p_item
)
...
...
@@ -384,7 +384,7 @@ void onPlay(GtkButton *button, gpointer user_data)
if
(
p_playlist
)
{
vlc_mutex_lock
(
&
p_playlist
->
object_lock
);
if
(
playlist_CurrentSize
(
p_
intf
))
if
(
playlist_CurrentSize
(
p_
playlist
))
{
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
playlist_Play
(
p_playlist
);
...
...
@@ -929,7 +929,7 @@ void onClearPlaylist(GtkButton *button, gpointer user_data)
return
;
}
for
(
item
=
playlist_CurrentSize
(
p_
intf
)
-
1
;
item
>=
0
;
item
--
)
for
(
item
=
playlist_CurrentSize
(
p_
playlist
)
-
1
;
item
>=
0
;
item
--
)
{
msg_Err
(
p_playlist
,
"fix pda delete"
);
}
...
...
src/control/media.c
View file @
82921f3c
...
...
@@ -22,7 +22,7 @@
*****************************************************************************/
#include "libvlc_internal.h"
#include "libvlc.h"
#include <vlc/libvlc.h>
#include <vlc_input.h>
#include <vlc_meta.h>
...
...
@@ -215,7 +215,7 @@ static void preparse_if_needed( libvlc_media_t *p_md )
if
(
!
p_md
->
b_preparsed
)
{
playlist_PreparseEnqueue
(
p_md
->
p_libvlc_instance
->
p_libvlc_int
->
p_playlist
,
libvlc_priv
(
p_md
->
p_libvlc_instance
->
p_libvlc_int
)
->
p_playlist
,
p_md
->
p_input_item
);
p_md
->
b_preparsed
=
true
;
}
...
...
@@ -430,7 +430,7 @@ char * libvlc_media_get_meta( libvlc_media_t *p_md,
if
(
e_meta
==
libvlc_meta_ArtworkURL
&&
!
psz_meta
)
{
playlist_AskForArtEnqueue
(
p_md
->
p_libvlc_instance
->
p_libvlc_int
->
p_playlist
,
libvlc_priv
(
p_md
->
p_libvlc_instance
->
p_libvlc_int
)
->
p_playlist
,
p_md
->
p_input_item
);
}
...
...
src/control/playlist.c
View file @
82921f3c
...
...
@@ -30,7 +30,7 @@
#include "../playlist/playlist_internal.h"
#define PL
p_instance->p_libvlc_int->p_playlist
#define PL
(libvlc_priv (p_instance->p_libvlc_int)->p_playlist)
static
inline
int
playlist_was_locked
(
libvlc_instance_t
*
p_instance
)
{
...
...
src/input/input.c
View file @
82921f3c
...
...
@@ -553,7 +553,7 @@ static int Run( input_thread_t *p_input )
/* We have finished */
p_input
->
b_eof
=
true
;
playlist_Signal
(
p_input
->
p_libvlc
->
p_playlist
);
playlist_Signal
(
libvlc_priv
(
p_input
->
p_libvlc
)
->
p_playlist
);
}
/* Wait until we are asked to die */
...
...
@@ -2110,7 +2110,8 @@ 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
(
p_input
->
p_libvlc
->
p_playlist
,
"item-change"
,
p_input
->
p
->
input
.
p_item
->
i_id
);
var_SetInteger
(
libvlc_priv
(
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,8 +2154,8 @@ static void UpdateItemLength( input_thread_t *p_input, int64_t i_length )
if
(
!
p_input
->
b_preparsing
)
{
pl_Yield
(
p_input
);
var_SetInteger
(
p_input
->
p_libvlc
->
p_playlist
,
"item-change"
,
p_input
->
p
->
input
.
p_item
->
i_id
);
var_SetInteger
(
libvlc_priv
(
p_input
->
p_libvlc
)
->
p_playlist
,
"item-change"
,
p_input
->
p
->
input
.
p_item
->
i_id
);
pl_Release
(
p_input
);
}
}
...
...
src/libvlc-common.c
View file @
82921f3c
...
...
@@ -179,7 +179,7 @@ libvlc_int_t * libvlc_InternalCreate( void )
return
NULL
;
priv
=
libvlc_priv
(
p_libvlc
);
p
_libvlc
->
p_playlist
=
NULL
;
p
riv
->
p_playlist
=
NULL
;
priv
->
p_interaction
=
NULL
;
priv
->
p_vlm
=
NULL
;
p_libvlc
->
psz_object_name
=
strdup
(
"libvlc"
);
...
...
@@ -736,7 +736,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
/* Initialize playlist and get commandline files */
playlist_ThreadCreate
(
p_libvlc
);
if
(
!
p
_libvlc
->
p_playlist
)
if
(
!
p
riv
->
p_playlist
)
{
msg_Err
(
p_libvlc
,
"playlist initialization failed"
);
if
(
priv
->
p_memcpy_module
!=
NULL
)
...
...
@@ -746,7 +746,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
module_EndBank
(
p_libvlc
);
return
VLC_EGENERIC
;
}
p_playlist
=
p
_libvlc
->
p_playlist
;
p_playlist
=
p
riv
->
p_playlist
;
psz_modules
=
config_GetPsz
(
p_playlist
,
"services-discovery"
);
if
(
psz_modules
&&
*
psz_modules
)
...
...
@@ -939,7 +939,7 @@ int libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
/* Free playlist */
msg_Dbg
(
p_libvlc
,
"removing playlist"
);
playlist_ThreadDestroy
(
p
_libvlc
->
p_playlist
);
playlist_ThreadDestroy
(
p
riv
->
p_playlist
);
/* Free video outputs */
msg_Dbg
(
p_libvlc
,
"removing all video outputs"
);
...
...
@@ -1138,7 +1138,7 @@ int libvlc_InternalAddIntf( libvlc_int_t *p_libvlc,
/* Interface doesn't handle play on start so do it ourselves */
if
(
!
p_intf
->
b_play
&&
b_play
)
playlist_Play
(
p_libvlc
->
p_playlist
);
playlist_Play
(
libvlc_priv
(
p_libvlc
)
->
p_playlist
);
/* Try to run the interface */
p_intf
->
b_play
=
b_play
;
...
...
src/libvlc.c
View file @
82921f3c
...
...
@@ -296,11 +296,12 @@ int VLC_VariableType( int i_object, char const *psz_var, int *pi_type )
#define LIBVLC_PLAYLIST_FUNC \
libvlc_int_t *p_libvlc = vlc_current_object( i_object );\
if( !p_libvlc || !p_libvlc->p_playlist ) return VLC_ENOOBJ; \
vlc_object_yield( p_libvlc->p_playlist );
if( !p_libvlc ) return VLC_ENOOBJ; \
playlist_t *p_playlist = pl_Yield( p_libvlc ); \
if( !p_playlist ) return VLC_ENOOBJ
#define LIBVLC_PLAYLIST_FUNC_END \
vlc_object_release( p_libvlc->p_playlist
); \
pl_Release( p_libvlc
); \
if( i_object ) vlc_object_release( p_libvlc );
/*****************************************************************************
...
...
@@ -315,7 +316,7 @@ int VLC_AddTarget( int i_object, char const *psz_target,
{
int
i_err
;
LIBVLC_PLAYLIST_FUNC
;
i_err
=
playlist_AddExt
(
p_
libvlc
->
p_
playlist
,
psz_target
,
i_err
=
playlist_AddExt
(
p_playlist
,
psz_target
,
NULL
,
i_mode
,
i_pos
,
-
1
,
ppsz_options
,
i_options
,
true
,
false
);
LIBVLC_PLAYLIST_FUNC_END
;
...
...
@@ -328,7 +329,7 @@ int VLC_AddTarget( int i_object, char const *psz_target,
int
VLC_Play
(
int
i_object
)
{
LIBVLC_PLAYLIST_FUNC
;
playlist_Play
(
p_
libvlc
->
p_
playlist
);
playlist_Play
(
p_playlist
);
LIBVLC_PLAYLIST_FUNC_END
;
return
VLC_SUCCESS
;
}
...
...
@@ -339,7 +340,7 @@ int VLC_Play( int i_object )
int
VLC_Pause
(
int
i_object
)
{
LIBVLC_PLAYLIST_FUNC
;
playlist_Pause
(
p_
libvlc
->
p_
playlist
);
playlist_Pause
(
p_playlist
);
LIBVLC_PLAYLIST_FUNC_END
;
return
VLC_SUCCESS
;
}
...
...
@@ -350,7 +351,7 @@ int VLC_Pause( int i_object )
int
VLC_Stop
(
int
i_object
)
{
LIBVLC_PLAYLIST_FUNC
;
playlist_Stop
(
p_
libvlc
->
p_
playlist
);
playlist_Stop
(
p_playlist
);
LIBVLC_PLAYLIST_FUNC_END
;
return
VLC_SUCCESS
;
}
...
...
@@ -363,15 +364,15 @@ bool VLC_IsPlaying( int i_object )
bool
b_playing
;
LIBVLC_PLAYLIST_FUNC
;
if
(
p_
libvlc
->
p_
playlist
->
p_input
)
if
(
p_playlist
->
p_input
)
{
vlc_value_t
val
;
var_Get
(
p_
libvlc
->
p_
playlist
->
p_input
,
"state"
,
&
val
);
var_Get
(
p_playlist
->
p_input
,
"state"
,
&
val
);
b_playing
=
(
val
.
i_int
==
PLAYING_S
);
}
else
{
b_playing
=
playlist_IsPlaying
(
p_
libvlc
->
p_
playlist
);
b_playing
=
playlist_IsPlaying
(
p_playlist
);
}
LIBVLC_PLAYLIST_FUNC_END
;
return
b_playing
;
...
...
@@ -672,7 +673,7 @@ int VLC_PlaylistNumberOfItems( int i_object )
{
int
i_size
;
LIBVLC_PLAYLIST_FUNC
;
i_size
=
p_
libvlc
->
p_
playlist
->
items
.
i_size
;
i_size
=
p_playlist
->
items
.
i_size
;
LIBVLC_PLAYLIST_FUNC_END
;
return
i_size
;
}
...
...
@@ -685,7 +686,7 @@ int VLC_PlaylistNumberOfItems( int i_object )
int
VLC_PlaylistNext
(
int
i_object
)
{
LIBVLC_PLAYLIST_FUNC
;
playlist_Next
(
p_
libvlc
->
p_
playlist
);
playlist_Next
(
p_playlist
);
LIBVLC_PLAYLIST_FUNC_END
;
return
VLC_SUCCESS
;
}
...
...
@@ -698,7 +699,7 @@ int VLC_PlaylistNext( int i_object )
int
VLC_PlaylistPrev
(
int
i_object
)
{
LIBVLC_PLAYLIST_FUNC
;
playlist_Prev
(
p_
libvlc
->
p_
playlist
);
playlist_Prev
(
p_playlist
);
LIBVLC_PLAYLIST_FUNC_END
;
return
VLC_SUCCESS
;
}
...
...
@@ -709,7 +710,7 @@ int VLC_PlaylistPrev( int i_object )
int
VLC_PlaylistClear
(
int
i_object
)
{
LIBVLC_PLAYLIST_FUNC
;
playlist_Clear
(
p_
libvlc
->
p_
playlist
,
true
);
playlist_Clear
(
p_playlist
,
true
);
LIBVLC_PLAYLIST_FUNC_END
;
return
VLC_SUCCESS
;
}
...
...
src/libvlc.h
View file @
82921f3c
...
...
@@ -232,7 +232,8 @@ typedef struct libvlc_priv_t
/// (needs cleanup)
module_t
*
p_memcpy_module
;
///< Fast memcpy plugin used
vlm_t
*
p_vlm
;
///< VLM if created from libvlc-common.c
playlist_t
*
p_playlist
;
//< the playlist singleton
vlm_t
*
p_vlm
;
///< the VLM singleton (or NULL)
vlc_object_t
*
p_interaction
;
///< interface interaction object
httpd_t
*
p_httpd
;
///< HTTP daemon (src/network/httpd.c)
}
libvlc_priv_t
;
...
...
src/misc/win32_specific.c
View file @
82921f3c
...
...
@@ -314,9 +314,7 @@ LRESULT CALLBACK WMCOPYWNDPROC( HWND hwnd, UINT uMsg, WPARAM wParam,
if
(
!
p_this
)
return
0
;
/* Add files to the playlist */
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_this
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
p_playlist
=
pl_Yield
(
p_this
);
if
(
!
p_playlist
)
return
0
;
if
(
pwm_data
->
lpData
)
...
...
src/playlist/control.c
View file @
82921f3c
...
...
@@ -43,7 +43,7 @@ static void PreparseEnqueueItemSub( playlist_t *, playlist_item_t * );
playlist_t
*
__pl_Yield
(
vlc_object_t
*
p_this
)
{
playlist_t
*
pl
=
p_this
->
p_libvlc
->
p_playlist
;
playlist_t
*
pl
=
libvlc_priv
(
p_this
->
p_libvlc
)
->
p_playlist
;
assert
(
pl
!=
NULL
);
vlc_object_yield
(
pl
);
return
pl
;
...
...
@@ -51,7 +51,7 @@ playlist_t *__pl_Yield( vlc_object_t *p_this )
void
__pl_Release
(
vlc_object_t
*
p_this
)
{
playlist_t
*
pl
=
p_this
->
p_libvlc
->
p_playlist
;
playlist_t
*
pl
=
libvlc_priv
(
p_this
->
p_libvlc
)
->
p_playlist
;
assert
(
pl
!=
NULL
);
vlc_object_release
(
pl
);
}
...
...
src/playlist/engine.c
View file @
82921f3c
...
...
@@ -74,7 +74,7 @@ playlist_t * playlist_Create( vlc_object_t *p_parent )
TAB_INIT
(
p_playlist
->
i_sds
,
p_playlist
->
pp_sds
);
p_parent
->
p_libvlc
->
p_playlist
=
p_playlist
;
libvlc_priv
(
p_parent
->
p_libvlc
)
->
p_playlist
=
p_playlist
;
VariablesInit
(
p_playlist
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment