Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
c029b7af
Commit
c029b7af
authored
Jan 31, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't start the playlist thread if not needed
parent
bbb25382
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
21 deletions
+37
-21
include/vlc_playlist.h
include/vlc_playlist.h
+4
-4
src/libvlc.c
src/libvlc.c
+3
-9
src/libvlc.h
src/libvlc.h
+1
-0
src/libvlccore.sym
src/libvlccore.sym
+2
-2
src/playlist/control.c
src/playlist/control.c
+26
-6
src/playlist/playlist_internal.h
src/playlist/playlist_internal.h
+1
-0
No files found.
include/vlc_playlist.h
View file @
c029b7af
...
...
@@ -255,11 +255,11 @@ enum pl_locked_state
#define PL_UNLOCK playlist_Unlock( p_playlist )
#define PL_ASSERT_LOCKED playlist_AssertLocked( p_playlist )
VLC_EXPORT
(
playlist_t
*
,
__
pl_Hold
,
(
vlc_object_t
*
)
);
#define pl_Hold( a )
__
pl_Hold( VLC_OBJECT(a) )
VLC_EXPORT
(
playlist_t
*
,
pl_Hold
,
(
vlc_object_t
*
)
);
#define pl_Hold( a ) pl_Hold( VLC_OBJECT(a) )
VLC_EXPORT
(
void
,
__
pl_Release
,
(
vlc_object_t
*
)
);
#define pl_Release(a)
__
pl_Release( VLC_OBJECT(a) )
VLC_EXPORT
(
void
,
pl_Release
,
(
vlc_object_t
*
)
);
#define pl_Release(a) pl_Release( VLC_OBJECT(a) )
/* Playlist control */
#define playlist_Play(p) playlist_Control(p,PLAYLIST_PLAY, pl_Unlocked )
...
...
src/libvlc.c
View file @
c029b7af
...
...
@@ -804,7 +804,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
module_EndBank
(
p_libvlc
,
true
);
return
VLC_EGENERIC
;
}
playlist_Activate
(
p_playlist
);
/* Add service discovery modules */
psz_modules
=
var_InheritString
(
p_libvlc
,
"services-discovery"
);
...
...
@@ -987,11 +986,11 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
void
libvlc_InternalCleanup
(
libvlc_int_t
*
p_libvlc
)
{
libvlc_priv_t
*
priv
=
libvlc_priv
(
p_libvlc
);
playlist_t
*
p_playlist
=
priv
->
p_playlist
;
playlist_t
*
p_playlist
=
libvlc_priv
(
p_libvlc
)
->
p_playlist
;
/* Deactivate the playlist */
msg_Dbg
(
p_libvlc
,
"deactivating the playlist"
);
pl
aylist_Deactivate
(
p_playlist
);
pl
_Deactivate
(
p_libvlc
);
/* Remove all services discovery */
msg_Dbg
(
p_libvlc
,
"removing all services discovery tasks"
);
...
...
@@ -1010,13 +1009,8 @@ void libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
}
#endif
/* Free playlist */
/* Any thread still running must not assume pl_Hold() succeeds. */
/* Free playlist now */
msg_Dbg
(
p_libvlc
,
"removing playlist"
);
libvlc_priv
(
p_libvlc
)
->
p_playlist
=
NULL
;
barrier
();
/* FIXME is that correct ? */
vlc_object_release
(
p_playlist
);
stats_TimersDumpAll
(
p_libvlc
);
...
...
src/libvlc.h
View file @
c029b7af
...
...
@@ -206,6 +206,7 @@ typedef struct libvlc_priv_t
libvlc_int_t
public_data
;
int
i_last_input_id
;
///< Last id of input item
bool
playlist_active
;
/* Messages */
msg_bank_t
msg_bank
;
///< The message bank
...
...
src/libvlccore.sym
View file @
c029b7af
...
...
@@ -343,8 +343,8 @@ playlist_Status
playlist_TreeMove
playlist_TreeMoveMany
playlist_Unlock
__
pl_Hold
__
pl_Release
pl_Hold
pl_Release
resolve_xml_special_chars
sdp_AddAttribute
sdp_AddMedia
...
...
src/playlist/control.c
View file @
c029b7af
...
...
@@ -39,22 +39,34 @@ static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args
* Playlist control
*****************************************************************************/
playlist_t
*
__pl_Hold
(
vlc_object_t
*
p_this
)
static
vlc_mutex_t
global_lock
=
VLC_STATIC_MUTEX
;
#undef pl_Hold
playlist_t
*
pl_Hold
(
vlc_object_t
*
obj
)
{
playlist_t
*
pl
;
libvlc_int_t
*
p_libvlc
=
obj
->
p_libvlc
;
barrier
();
pl
=
libvlc_priv
(
p_this
->
p_libvlc
)
->
p_playlist
;
vlc_mutex_lock
(
&
global_lock
);
pl
=
libvlc_priv
(
p_libvlc
)
->
p_playlist
;
assert
(
pl
!=
NULL
);
assert
(
VLC_OBJECT
(
pl
)
!=
p_this
/* This does not make sense to hold the playlist
using pl_Hold. use vlc_object_hold in this case */
);
if
(
!
libvlc_priv
(
p_libvlc
)
->
playlist_active
)
{
playlist_Activate
(
pl
);
libvlc_priv
(
p_libvlc
)
->
playlist_active
=
true
;
}
/* The playlist should hold itself with vlc_object_hold() if ever. */
assert
(
VLC_OBJECT
(
pl
)
!=
obj
);
if
(
pl
)
vlc_object_hold
(
pl
);
vlc_mutex_unlock
(
&
global_lock
);
return
pl
;
}
void
__pl_Release
(
vlc_object_t
*
p_this
)
#undef pl_Release
void
pl_Release
(
vlc_object_t
*
p_this
)
{
playlist_t
*
pl
=
libvlc_priv
(
p_this
->
p_libvlc
)
->
p_playlist
;
assert
(
pl
!=
NULL
);
...
...
@@ -66,6 +78,14 @@ void __pl_Release( vlc_object_t *p_this )
vlc_object_release
(
pl
);
}
void
pl_Deactivate
(
libvlc_int_t
*
p_libvlc
)
{
vlc_mutex_lock
(
&
global_lock
);
if
(
libvlc_priv
(
p_libvlc
)
->
playlist_active
)
playlist_Deactivate
(
libvlc_priv
(
p_libvlc
)
->
p_playlist
);
vlc_mutex_unlock
(
&
global_lock
);
}
void
playlist_Lock
(
playlist_t
*
pl
)
{
vlc_mutex_lock
(
&
pl_priv
(
pl
)
->
lock
);
...
...
src/playlist/playlist_internal.h
View file @
c029b7af
...
...
@@ -105,6 +105,7 @@ playlist_t *playlist_Create( vlc_object_t * );
/* */
void
playlist_Activate
(
playlist_t
*
);
void
playlist_Deactivate
(
playlist_t
*
);
void
pl_Deactivate
(
libvlc_int_t
*
);
/* */
playlist_item_t
*
playlist_ItemNewFromInput
(
playlist_t
*
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