Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
d228fdd2
Commit
d228fdd2
authored
Sep 27, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist: Move more members as private.
parent
696f3a43
Changes
22
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
266 additions
and
269 deletions
+266
-269
include/vlc_playlist.h
include/vlc_playlist.h
+16
-50
modules/access/cdda.c
modules/access/cdda.c
+2
-2
modules/access/cdda/info.c
modules/access/cdda/info.c
+2
-2
modules/codec/cmml/intf.c
modules/codec/cmml/intf.c
+3
-3
modules/control/gestures.c
modules/control/gestures.c
+1
-9
modules/control/hotkeys.c
modules/control/hotkeys.c
+4
-7
modules/control/http/http.c
modules/control/http/http.c
+1
-2
modules/control/http/util.c
modules/control/http/util.c
+4
-4
modules/control/rc.c
modules/control/rc.c
+29
-23
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+4
-5
modules/gui/macosx/playlist.m
modules/gui/macosx/playlist.m
+6
-7
modules/gui/ncurses.c
modules/gui/ncurses.c
+9
-16
modules/misc/audioscrobbler.c
modules/misc/audioscrobbler.c
+3
-15
modules/misc/lua/libs/input.c
modules/misc/lua/libs/input.c
+1
-4
modules/misc/lua/libs/playlist.c
modules/misc/lua/libs/playlist.c
+9
-2
src/control/playlist.c
src/control/playlist.c
+6
-9
src/libvlccore.sym
src/libvlccore.sym
+4
-0
src/playlist/control.c
src/playlist/control.c
+45
-45
src/playlist/engine.c
src/playlist/engine.c
+67
-46
src/playlist/item.c
src/playlist/item.c
+9
-9
src/playlist/playlist_internal.h
src/playlist/playlist_internal.h
+32
-0
src/playlist/services_discovery.c
src/playlist/services_discovery.c
+9
-9
No files found.
include/vlc_playlist.h
View file @
d228fdd2
...
...
@@ -158,14 +158,6 @@ struct playlist_t
{
VLC_COMMON_MEMBERS
struct
playlist_services_discovery_support_t
{
/* the playlist items for category and onelevel */
playlist_item_t
*
p_cat
;
playlist_item_t
*
p_one
;
services_discovery_t
*
p_sd
;
/**< Loaded service discovery modules */
}
**
pp_sds
;
int
i_sds
;
/**< Number of service discovery modules */
playlist_item_array_t
items
;
/**< Arrays of items */
playlist_item_array_t
all_items
;
/**< Array of items and nodes */
playlist_item_array_t
items_to_delete
;
/**< Array of items and nodes to
...
...
@@ -194,34 +186,11 @@ struct playlist_t
bool
b_auto_preparse
;
/* Runtime */
input_thread_t
*
p_input
;
/**< the input thread associated
* with the current item */
int
i_sort
;
/**< Last sorting applied to the playlist */
int
i_order
;
/**< Last ordering applied to the playlist */
mtime_t
gc_date
;
bool
b_cant_sleep
;
struct
{
/* Current status. These fields are readonly, only the playlist
* main loop can touch it*/
playlist_status_t
i_status
;
/**< Current status of playlist */
playlist_item_t
*
p_item
;
/**< Currently playing/active item */
playlist_item_t
*
p_node
;
/**< Current node to play from */
}
status
;
struct
{
/* Request. Use this to give orders to the playlist main loop */
playlist_status_t
i_status
;
/**< requested playlist status */
playlist_item_t
*
p_node
;
/**< requested node to play from */
playlist_item_t
*
p_item
;
/**< requested item to play in the node */
int
i_skip
;
/**< Number of items to skip */
bool
b_request
;
/**< Set to true by the requester
The playlist sets it back to false
when processing the request */
vlc_mutex_t
lock
;
/**< Lock to protect request */
}
request
;
};
/** Helper to add an item */
...
...
@@ -316,19 +285,15 @@ VLC_EXPORT( int, playlist_PreparseEnqueueItem, (playlist_t *, playlist_item_t *)
/** Request the art for an input item to be fetched */
VLC_EXPORT
(
int
,
playlist_AskForArtEnqueue
,
(
playlist_t
*
,
input_item_t
*
)
);
/********************** Services discovery ***********************/
/** Add a list of comma-separated service discovery modules */
VLC_EXPORT
(
int
,
playlist_ServicesDiscoveryAdd
,
(
playlist_t
*
,
const
char
*
));
/** Remove a services discovery module by name */
VLC_EXPORT
(
int
,
playlist_ServicesDiscoveryRemove
,
(
playlist_t
*
,
const
char
*
));
/** Check whether a given SD is loaded */
VLC_EXPORT
(
bool
,
playlist_IsServicesDiscoveryLoaded
,
(
playlist_t
*
,
const
char
*
));
/* Playlist sorting */
VLC_EXPORT
(
int
,
playlist_TreeMove
,
(
playlist_t
*
,
playlist_item_t
*
,
playlist_item_t
*
,
int
)
);
VLC_EXPORT
(
int
,
playlist_RecursiveNodeSort
,
(
playlist_t
*
,
playlist_item_t
*
,
int
,
int
)
);
VLC_EXPORT
(
playlist_item_t
*
,
playlist_CurrentPlayingItem
,
(
playlist_t
*
)
);
VLC_EXPORT
(
int
,
playlist_CurrentId
,
(
playlist_t
*
)
);
VLC_EXPORT
(
bool
,
playlist_IsPlaying
,
(
playlist_t
*
)
);
VLC_EXPORT
(
int
,
playlist_Status
,
(
playlist_t
*
)
);
/**
* Export a node of the playlist to a certain type of playlistfile
* \param p_playlist the playlist to export
...
...
@@ -339,6 +304,17 @@ VLC_EXPORT( int, playlist_RecursiveNodeSort, ( playlist_t *, playlist_item_t *,
*/
VLC_EXPORT
(
int
,
playlist_Export
,
(
playlist_t
*
p_playlist
,
const
char
*
psz_name
,
playlist_item_t
*
p_export_root
,
const
char
*
psz_type
)
);
/********************** Services discovery ***********************/
/** Add a list of comma-separated service discovery modules */
VLC_EXPORT
(
int
,
playlist_ServicesDiscoveryAdd
,
(
playlist_t
*
,
const
char
*
));
/** Remove a services discovery module by name */
VLC_EXPORT
(
int
,
playlist_ServicesDiscoveryRemove
,
(
playlist_t
*
,
const
char
*
));
/** Check whether a given SD is loaded */
VLC_EXPORT
(
bool
,
playlist_IsServicesDiscoveryLoaded
,
(
playlist_t
*
,
const
char
*
));
/********************************************************
* Item management
********************************************************/
...
...
@@ -427,22 +403,12 @@ static inline input_thread_t * __pl_CurrentInput( vlc_object_t * p_this )
return
p_input
;
}
/** Tell if the playlist is currently running */
#define playlist_IsPlaying( pl ) ( pl->status.i_status == PLAYLIST_RUNNING && \
!(pl->request.b_request && pl->request.i_status == PLAYLIST_STOPPED) )
#define playlist_IsStopped( pl ) ( pl->status.i_status == PLAYLIST_STOPPED || \
(pl->request.b_request && pl->request.i_status == PLAYLIST_STOPPED) )
/** Tell if the playlist is empty */
#define playlist_IsEmpty( pl ) ( pl->items.i_size == 0 )
/** Tell the number of items in the current playing context */
#define playlist_CurrentSize( pl ) pl->current.i_size
/** Tell the current item id in current playing context */
#define playlist_CurrentId( pl ) pl->status.p_item->i_id
/** Ask the playlist to do some work */
#define playlist_Signal( p_playlist ) vlc_object_signal( p_playlist )
...
...
modules/access/cdda.c
View file @
d228fdd2
...
...
@@ -198,8 +198,8 @@ static int Open( vlc_object_t *p_this )
input_item_t
*
p_current
=
input_GetItem
(
p_input
);
playlist_item_t
*
p_item
;
if
(
p
_playlist
->
status
.
p_item
->
p_input
==
p_current
)
p_item
=
p
_playlist
->
status
.
p_item
;
if
(
p
laylist_CurrentPlayingItem
(
p_playlist
)
->
p_input
==
p_current
)
p_item
=
p
laylist_CurrentPlayingItem
(
p_playlist
)
;
else
p_item
=
playlist_ItemGetByInput
(
p_playlist
,
p_current
,
pl_Unlocked
);
...
...
modules/access/cdda/info.c
View file @
d228fdd2
...
...
@@ -884,7 +884,7 @@ CDDAFixupPlaylist( access_t *p_access, cdda_data_t *p_cdda,
{
p_item
=
playlist_ItemGetByInput
(
p_playlist
,
input_GetItem
(
p_input
),
pl_Unlocked
);
if
(
p_item
==
p
_playlist
->
status
.
p_item
&&
!
b_single_track
)
if
(
p_item
==
p
laylist_CurrentPlayingItem
(
p_playlist
)
&&
!
b_single_track
)
b_play
=
true
;
else
b_play
=
false
;
...
...
@@ -964,7 +964,7 @@ CDDAFixupPlaylist( access_t *p_access, cdda_data_t *p_cdda,
if
(
b_play
)
{
playlist_Control
(
p_playlist
,
PLAYLIST_VIEWPLAY
,
pl_Unlocked
,
p
_playlist
->
status
.
p_item
,
NULL
);
p
laylist_CurrentPlayingItem
(
p_playlist
)
,
NULL
);
}
if
(
p_playlist
)
pl_Release
(
p_access
);
...
...
modules/codec/cmml/intf.c
View file @
d228fdd2
...
...
@@ -440,7 +440,7 @@ static void FollowAnchor ( intf_thread_t *p_intf )
p_playlist
=
pl_Hold
(
p_intf
);
/* Get new URL */
p_current_item
=
p
_playlist
->
status
.
p_item
;
p_current_item
=
p
laylist_CurrentPlayingItem
(
p_playlist
)
;
char
*
psz_uri
=
input_item_GetURI
(
p_current_item
->
p_input
);
#ifdef CMML_INTF_DEBUG
msg_Dbg
(
p_intf
,
"Current playlist item URL is
\"
%s
\"
"
,
psz_uri
);
...
...
@@ -668,7 +668,7 @@ void GoBack( intf_thread_t *p_intf )
return
;
}
p_current_item
=
p
_playlist
->
status
.
p_item
;
p_current_item
=
p
laylist_CurrentPlayingItem
(
p_playlist
)
;
/* Save the currently-playing media in a new history item */
psz_timed_url
=
GetTimedURLFromPlaylistItem
(
p_intf
,
p_current_item
);
...
...
@@ -750,7 +750,7 @@ void GoForward( intf_thread_t *p_intf )
vlc_object_release
(
p_playlist
);
return
;
}
p_current_item
=
p
_playlist
->
status
.
p_item
;
p_current_item
=
p
laylist_CurrentPlayingItem
(
p_playlist
)
;
p_new_history_item
->
psz_uri
=
GetTimedURLFromPlaylistItem
(
p_intf
,
p_current_item
);
p_new_history_item
->
psz_name
=
p_new_history_item
->
psz_uri
;
...
...
modules/control/gestures.c
View file @
d228fdd2
...
...
@@ -139,15 +139,7 @@ static int gesture( int i_pattern, int i_num )
*****************************************************************************/
static
input_thread_t
*
input_from_playlist
(
playlist_t
*
p_playlist
)
{
input_thread_t
*
p_input
;
PL_LOCK
;
p_input
=
p_playlist
->
p_input
;
if
(
p_input
)
vlc_object_hold
(
p_input
);
PL_UNLOCK
;
return
p_input
;
return
playlist_CurrentInput
(
p_playlist
);
}
/*****************************************************************************
...
...
modules/control/hotkeys.c
View file @
d228fdd2
...
...
@@ -174,11 +174,7 @@ static void Run( intf_thread_t *p_intf )
canc
=
vlc_savecancel
();
/* Update the input */
PL_LOCK
;
p_input
=
p_playlist
->
p_input
;
if
(
p_input
)
vlc_object_hold
(
p_input
);
PL_UNLOCK
;
p_input
=
playlist_CurrentInput
(
p_playlist
);
/* Update the vout */
p_last_vout
=
p_vout
;
...
...
@@ -978,9 +974,10 @@ static void SetBookmark( intf_thread_t *p_intf, int i_num )
sprintf
(
psz_bookmark_name
,
"bookmark%i"
,
i_num
);
var_Create
(
p_intf
,
psz_bookmark_name
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
if
(
p_playlist
->
status
.
p_item
)
playlist_item_t
*
p_item
=
playlist_CurrentPlayingItem
(
p_playlist
);
if
(
p_item
)
{
char
*
psz_uri
=
input_item_GetURI
(
p_
playlist
->
status
.
p_
item
->
p_input
);
char
*
psz_uri
=
input_item_GetURI
(
p_item
->
p_input
);
config_PutPsz
(
p_intf
,
psz_bookmark_name
,
psz_uri
);
msg_Info
(
p_intf
,
"setting playlist bookmark %i to %s"
,
i_num
,
psz_uri
);
free
(
psz_uri
);
...
...
modules/control/http/http.c
View file @
d228fdd2
...
...
@@ -384,10 +384,9 @@ static void ParseExecute( httpd_file_sys_t *p_args, char *p_buffer,
assert
(
p_sys
->
p_input
==
NULL
);
/* FIXME: proper locking anyone? */
p_sys
->
p_input
=
p
_sys
->
p_playlist
->
p_input
;
p_sys
->
p_input
=
p
laylist_CurrentInput
(
p_sys
->
p_playlist
)
;
if
(
p_sys
->
p_input
)
{
vlc_object_hold
(
p_sys
->
p_input
);
var_Get
(
p_sys
->
p_input
,
"position"
,
&
val
);
sprintf
(
position
,
"%d"
,
(
int
)((
val
.
f_float
)
*
100
.
0
));
var_Get
(
p_sys
->
p_input
,
"time"
,
&
val
);
...
...
modules/control/http/util.c
View file @
d228fdd2
...
...
@@ -352,10 +352,10 @@ void PlaylistListNode( intf_thread_t *p_intf, playlist_t *p_pl,
char
value
[
512
];
char
*
psz
;
mvar_t
*
itm
=
mvar_New
(
name
,
"set"
);
if
(
p_
pl
->
status
.
p_
item
&&
p_node
&&
p_
pl
->
status
.
p_
item
->
p_input
&&
p_node
->
p_input
&&
p_
pl
->
status
.
p_
item
->
p_input
->
i_id
==
p_node
->
p_input
->
i_id
)
playlist_item_t
*
p_item
=
playlist_CurrentPlayingItem
(
p_pl
);
if
(
p_item
&&
p_node
&&
p_item
->
p_input
&&
p_node
->
p_input
&&
p_item
->
p_input
->
i_id
==
p_node
->
p_input
->
i_id
)
{
mvar_AppendNewVar
(
itm
,
"current"
,
"1"
);
}
...
...
modules/control/rc.c
View file @
d228fdd2
...
...
@@ -553,24 +553,25 @@ static void Run( intf_thread_t *p_intf )
(
p_playlist
!=
NULL
)
)
{
PL_LOCK
;
if
(
(
p_intf
->
p_sys
->
i_last_state
!=
p_playlist
->
status
.
i_status
)
&&
(
p_playlist
->
status
.
i_status
==
PLAYLIST_STOPPED
)
)
int
status
=
playlist_Status
(
p_playlist
);
if
(
(
p_intf
->
p_sys
->
i_last_state
!=
status
)
&&
(
status
==
PLAYLIST_STOPPED
)
)
{
p_intf
->
p_sys
->
i_last_state
=
PLAYLIST_STOPPED
;
msg_rc
(
STATUS_CHANGE
"( stop state: 5 )"
);
}
else
if
(
(
p_intf
->
p_sys
->
i_last_state
!=
p_playlist
->
status
.
i_
status
)
&&
(
p_playlist
->
status
.
i_
status
==
PLAYLIST_RUNNING
)
)
(
p_intf
->
p_sys
->
i_last_state
!=
status
)
&&
(
status
==
PLAYLIST_RUNNING
)
)
{
p_intf
->
p_sys
->
i_last_state
=
p_playlist
->
status
.
i_status
;
p_intf
->
p_sys
->
i_last_state
=
PLAYLIST_RUNNING
;
msg_rc
(
STATUS_CHANGE
"( play state: 3 )"
);
}
else
if
(
(
p_intf
->
p_sys
->
i_last_state
!=
p_playlist
->
status
.
i_
status
)
&&
(
p_playlist
->
status
.
i_
status
==
PLAYLIST_PAUSED
)
)
(
p_intf
->
p_sys
->
i_last_state
!=
status
)
&&
(
status
==
PLAYLIST_PAUSED
)
)
{
p_intf
->
p_sys
->
i_last_state
=
p_playlist
->
status
.
i_status
;
p_intf
->
p_sys
->
i_last_state
=
PLAYLIST_PAUSED
;
msg_rc
(
STATUS_CHANGE
"( pause state: 4 )"
);
}
PL_UNLOCK
;
...
...
@@ -993,7 +994,7 @@ static int StateChanged( vlc_object_t *p_this, char const *psz_cmd,
{
p_playlist
=
pl_Hold
(
p_input
);
char
cmd
[
6
];
switch
(
p
_playlist
->
status
.
i_status
)
switch
(
p
laylist_Status
(
p_playlist
)
)
{
case
PLAYLIST_STOPPED
:
strcpy
(
cmd
,
"stop"
);
...
...
@@ -1304,20 +1305,20 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
p_this
;
playlist_t
*
p_playlist
=
pl_Hold
(
p_this
);
input_thread_t
*
p_input
=
playlist_CurrentInput
(
p_playlist
);
PL_LOCK
;
if
(
p_playlist
->
p_input
)
if
(
p_input
)
{
var_Get
(
p_playlist
->
p_input
,
"state"
,
&
val
);
var_Get
(
p_input
,
"state"
,
&
val
);
vlc_object_release
(
p_input
);
if
(
(
val
.
i_int
==
PAUSE_S
)
||
(
val
.
i_int
==
PLAYLIST_PAUSED
)
)
{
msg_rc
(
_
(
"Type 'menu select' or 'pause' to continue."
)
);
vlc_object_release
(
p_playlist
);
PL_UNLOCK
;
pl_Release
(
p_this
);
return
VLC_EGENERIC
;
}
}
PL_UNLOCK
;
/* Parse commands that require a playlist */
if
(
!
strcmp
(
psz_cmd
,
"prev"
)
)
...
...
@@ -1476,18 +1477,19 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
}
else
if
(
!
strcmp
(
psz_cmd
,
"status"
)
)
{
if
(
p_playlist
->
p_input
)
input_thread_t
*
p_input
=
playlist_CurrentInput
(
p_playlist
);
if
(
p_input
)
{
/* Replay the current state of the system. */
char
*
psz_uri
=
input_item_GetURI
(
input_GetItem
(
p_
playlist
->
p_
input
)
);
input_item_GetURI
(
input_GetItem
(
p_input
)
);
msg_rc
(
STATUS_CHANGE
"( new input: %s )"
,
psz_uri
);
free
(
psz_uri
);
msg_rc
(
STATUS_CHANGE
"( audio volume: %d )"
,
config_GetInt
(
p_intf
,
"volume"
));
PL_LOCK
;
switch
(
p
_playlist
->
status
.
i_status
)
switch
(
p
laylist_Status
(
p_playlist
)
)
{
case
PLAYLIST_STOPPED
:
msg_rc
(
STATUS_CHANGE
"( stop state: 5 )"
);
...
...
@@ -1503,6 +1505,7 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
break
;
}
PL_UNLOCK
;
vlc_object_release
(
p_input
);
}
}
...
...
@@ -1514,7 +1517,7 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
msg_rc
(
"unknown command!"
);
}
vlc_object_release
(
p_playlist
);
pl_Release
(
p_this
);
return
VLC_SUCCESS
;
}
...
...
@@ -1913,19 +1916,22 @@ static int Menu( vlc_object_t *p_this, char const *psz_cmd,
}
p_playlist
=
pl_Hold
(
p_this
);
input_thread_t
*
p_input
=
playlist_CurrentInput
(
p_playlist
);
if
(
p_
playlist
->
p_
input
)
if
(
p_input
)
{
var_Get
(
p_playlist
->
p_input
,
"state"
,
&
val
);
var_Get
(
p_input
,
"state"
,
&
val
);
vlc_object_release
(
p_input
);
if
(
(
(
val
.
i_int
==
PAUSE_S
)
||
(
val
.
i_int
==
PLAYLIST_PAUSED
)
)
&&
(
strcmp
(
newval
.
psz_string
,
"select"
)
!=
0
)
)
{
msg_rc
(
_
(
"Type 'menu select' or 'pause' to continue."
)
);
vlc_object_release
(
p_playlist
);
pl_Release
(
p_this
);
return
VLC_EGENERIC
;
}
}
vlc_object_release
(
p_playlist
);
pl_Release
(
p_this
);
val
.
psz_string
=
strdup
(
newval
.
psz_string
);
if
(
!
val
.
psz_string
)
...
...
modules/gui/macosx/intf.m
View file @
d228fdd2
...
...
@@ -1802,12 +1802,11 @@ end:
if
(
p_input
&&
vlc_object_alive
(
p_input
)
)
{
NSString
*
o_temp
;
if
(
input_item_GetNowPlaying
(
p_playlist
->
status
.
p_item
->
p_input
)
)
o_temp
=
[
NSString
stringWithUTF8String
:
input_item_GetNowPlaying
(
p_playlist
->
status
.
p_item
->
p_input
)];
playlist_item_t
*
p_item
=
playlist_CurrentPlayingItem
(
p_playlist
);
if
(
input_item_GetNowPlaying
(
p_item
->
p_input
)
)
o_temp
=
[
NSString
stringWithUTF8String
:
input_item_GetNowPlaying
(
p_item
->
p_input
)];
else
o_temp
=
[
NSString
stringWithUTF8String
:
p_playlist
->
status
.
p_item
->
p_input
->
psz_name
];
o_temp
=
[
NSString
stringWithUTF8String
:
p_item
->
p_input
->
psz_name
];
[
self
setScrollField
:
o_temp
stopAfter
:
-
1
];
[[[
self
getControls
]
getFSPanel
]
setStreamTitle
:
o_temp
];
vlc_object_release
(
p_input
);
...
...
modules/gui/macosx/playlist.m
View file @
d228fdd2
...
...
@@ -565,10 +565,10 @@
playlist_item_t
*
p_item
,
*
p_temp_item
;
NSMutableArray
*
o_array
=
[
NSMutableArray
array
];
p_item
=
p
_playlist
->
status
.
p_item
;
p_item
=
p
laylist_CurrentPlayingItem
(
p_playlist
)
;
if
(
p_item
==
NULL
)
{
vlc_object_release
(
p_playlist
);
pl_Release
(
VLCIntf
);
return
;
}
...
...
@@ -591,8 +591,7 @@
}
vlc_object_release
(
p_playlist
);
pl_Release
(
VLCIntf
);
}
/* Check if p_item is a child of p_node recursively. We need to check the item
...
...
@@ -904,8 +903,8 @@
if
(
p_item
->
i_children
!=
-
1
)
//is a node and not an item
{
if
(
p
_playlist
->
status
.
i_status
!=
PLAYLIST_STOPPED
&&
[
self
isItem
:
p
_playlist
->
status
.
p_item
inNode
:
if
(
p
laylist_Status
(
p_playlist
)
!=
PLAYLIST_STOPPED
&&
[
self
isItem
:
p
laylist_CurrentPlayingItem
(
p_playlist
)
inNode
:
((
playlist_item_t
*
)[
o_item
pointerValue
])
checkItemExistence:
NO
locked
:
YES
]
==
YES
)
// if current item is in selected node and is playing then stop playlist
...
...
@@ -1378,7 +1377,7 @@
id
o_playing_item
;
o_playing_item
=
[
o_outline_dict
objectForKey
:
[
NSString
stringWithFormat
:
@"%p"
,
p
_playlist
->
status
.
p_item
]];
[
NSString
stringWithFormat
:
@"%p"
,
p
laylist_CurrentPlayingItem
(
p_playlist
)
]];
if
(
[
self
isItem
:
[
o_playing_item
pointerValue
]
inNode
:
[
item
pointerValue
]
checkItemExistence
:
YES
]
...
...
modules/gui/ncurses.c
View file @
d228fdd2
...
...
@@ -412,14 +412,7 @@ static void Run( intf_thread_t *p_intf )
PL_LOCK
;
if
(
p_sys
->
p_input
==
NULL
)
{
p_sys
->
p_input
=
p_playlist
->
p_input
;
if
(
p_sys
->
p_input
)
{
if
(
!
p_sys
->
p_input
->
b_dead
)
{
vlc_object_hold
(
p_sys
->
p_input
);
}
}
p_sys
->
p_input
=
playlist_CurrentInput
(
p_playlist
);
}
else
if
(
p_sys
->
p_input
->
b_dead
)
{
...
...
@@ -430,7 +423,7 @@ static void Run( intf_thread_t *p_intf )
}
PL_UNLOCK
;
if
(
p_sys
->
b_box_plidx_follow
&&
p
_playlist
->
status
.
p_item
)
if
(
p_sys
->
b_box_plidx_follow
&&
p
laylist_CurrentPlayingItem
(
p_playlist
)
)
{
FindIndex
(
p_intf
);
}
...
...
@@ -794,7 +787,7 @@ static int HandleKey( intf_thread_t *p_intf, int i_key )
playlist_item_t
*
p_parent
=
p_sys
->
p_node
;
if
(
!
p_parent
)
p_parent
=
p
_playlist
->
status
.
p_node
;
p_parent
=
p
laylist_CurrentPlayingItem
(
p_playlist
)
?
playlist_CurrentPlayingItem
(
p_playlist
)
->
p_parent
:
NULL
;
if
(
!
p_parent
)
p_parent
=
p_playlist
->
p_local_onelevel
;
...
...
@@ -996,7 +989,7 @@ static int HandleKey( intf_thread_t *p_intf, int i_key )
playlist_item_t
*
p_parent
=
p_sys
->
p_node
;
if
(
!
p_parent
)
p_parent
=
p
_playlist
->
status
.
p_node
;
p_parent
=
p
laylist_CurrentPlayingItem
(
p_playlist
)
?
playlist_CurrentPlayingItem
(
p_playlist
)
->
p_parent
:
NULL
;
if
(
!
p_parent
)
p_parent
=
p_playlist
->
p_local_onelevel
;
...
...
@@ -2187,7 +2180,7 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
int
c
=
' '
;
if
(
(
p_node
&&
p_item
->
p_input
==
p_node
->
p_input
)
||
(
!
p_node
&&
p_item
->
p_input
==
p
_playlist
->
status
.
p_node
->
p_input
)
)
p
laylist_CurrentPlayingItem
(
p_playlist
)
->
p_input
)
)
c
=
'*'
;
else
if
(
p_item
==
p_node
||
(
p_item
!=
p_node
&&
PlaylistIsPlaying
(
p_intf
,
p_item
)
)
)
...
...
@@ -2350,7 +2343,7 @@ static int PlaylistChanged( vlc_object_t *p_this, const char *psz_variable,
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
param
;
playlist_t
*
p_playlist
=
pl_Hold
(
p_intf
);
p_intf
->
p_sys
->
b_need_update
=
true
;
p_intf
->
p_sys
->
p_node
=
p
_playlist
->
status
.
p_node
;
p_intf
->
p_sys
->
p_node
=
p
laylist_CurrentPlayingItem
(
p_playlist
)
?
playlist_CurrentPlayingItem
(
p_playlist
)
->
p_parent
:
NULL
;
vlc_object_release
(
p_playlist
);
return
VLC_SUCCESS
;
}
...
...
@@ -2360,7 +2353,7 @@ static inline bool PlaylistIsPlaying( intf_thread_t *p_intf,
playlist_item_t
*
p_item
)
{
playlist_t
*
p_playlist
=
pl_Hold
(
p_intf
);
playlist_item_t
*
p_played_item
=
p
_playlist
->
status
.
p_item
;
playlist_item_t
*
p_played_item
=
p
laylist_CurrentPlayingItem
(
p_playlist
)
;
vlc_object_release
(
p_playlist
);
return
(
p_item
!=
NULL
&&
p_played_item
!=
NULL
&&
p_item
->
p_input
!=
NULL
&&
p_played_item
->
p_input
!=
NULL
&&
...
...
@@ -2419,14 +2412,14 @@ static void Eject( intf_thread_t *p_intf )
playlist_t
*
p_playlist
=
pl_Hold
(
p_intf
);
PL_LOCK
;
if
(
p
_playlist
->
status
.
p_item
==
NULL
)
if
(
p
laylist_CurrentPlayingItem
(
p_playlist
)
==
NULL
)
{
PL_UNLOCK
;
vlc_object_release
(
p_playlist
);
return
;
}
psz_name
=
p
_playlist
->
status
.
p_item
->
p_input
->
psz_name
;
psz_name
=
p
laylist_CurrentPlayingItem
(
p_playlist
)
->
p_input
->
psz_name
;
if
(
psz_name
)
{
...
...
modules/misc/audioscrobbler.c
View file @
d228fdd2
...
...
@@ -208,22 +208,18 @@ static void Close( vlc_object_t *p_this )
p_playlist
=
pl_Hold
(
p_intf
);
if
(
p_playlist
)
{
PL_LOCK
;
var_DelCallback
(
p_playlist
,
"playlist-current"
,
ItemChange
,
p_intf
);
p_input
=
p
_playlist
->
p_input
;
p_input
=
p
laylist_CurrentInput
(
p_playlist
)
;
if
(
p_input
)
{
vlc_object_hold
(
p_input
);
if
(
p_sys
->
b_state_cb
)
var_DelCallback
(
p_input
,
"state"
,
PlayingChange
,
p_intf
);
vlc_object_release
(
p_input
);
}
PL_UNLOCK
;
pl_Release
(
p_intf
);
}
...
...
@@ -506,18 +502,14 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
p_sys
->
b_submit
=
false
;
p_playlist
=
pl_Hold
(
p_intf
);
PL_LOCK
;
p_input
=
p_playlist
->
p_input
;
p_input
=
playlist_CurrentInput
(
p_playlist
);
if
(
!
p_input
||
p_input
->
b_dead
)
{
PL_UNLOCK
;
pl_Release
(
p_intf
);
return
VLC_SUCCESS
;
}
vlc_object_hold
(
p_input
);
PL_UNLOCK
;
pl_Release
(
p_intf
);
p_item
=
input_GetItem
(
p_input
);
...
...
@@ -921,17 +913,13 @@ static int ReadMetaData( intf_thread_t *p_this )
intf_sys_t
*
p_sys
=
p_this
->
p_sys
;
p_playlist
=
pl_Hold
(
p_this
);
PL_LOCK
;
p_input
=
p_playlist
->
p_input
;
p_input
=
playlist_CurrentInput
(
p_playlist
);
if
(
!
p_input
)
{
PL_UNLOCK
;
pl_Release
(
p_this
);
return
(
VLC_SUCCESS
);
}
vlc_object_hold
(
p_input
);
PL_UNLOCK
;
pl_Release
(
p_this
);
p_item
=
input_GetItem
(
p_input
);
...
...
modules/misc/lua/libs/input.c
View file @
d228fdd2
...
...
@@ -49,10 +49,7 @@
input_thread_t
*
vlclua_get_input_internal
(
lua_State
*
L
)
{
playlist_t
*
p_playlist
=
vlclua_get_playlist_internal
(
L
);
PL_LOCK
;
input_thread_t
*
p_input
=
p_playlist
->
p_input
;
if
(
p_input
)
vlc_object_hold
(
p_input
);
PL_UNLOCK
;
input_thread_t
*
p_input
=
playlist_CurrentInput
(
p_playlist
);
vlclua_release_playlist_internal
(
p_playlist
);
return
p_input
;
}
...
...
modules/misc/lua/libs/playlist.c
View file @
d228fdd2
...
...
@@ -268,6 +268,7 @@ static int vlclua_playlist_get( lua_State *L )
else
{
int
i
;
#ifdef FIX_THAT_CODE_NOT_TO_MESS_WITH_PLAYLIST_INTERNALS
for
(
i
=
0
;
i
<
p_playlist
->
i_sds
;
i
++
)
{
if
(
!
strcasecmp
(
psz_what
,
...
...
@@ -278,6 +279,10 @@ static int vlclua_playlist_get( lua_State *L )
break
;
}
}
#else
# warning Don't access playlist iternal, broken code here.
abort
();
#endif
if
(
!
p_item
)
{
PL_UNLOCK
;
...
...
@@ -372,7 +377,8 @@ static int vlclua_playlist_status( lua_State *L )
/*
int i_count = 0;
lua_settop( L, 0 );*/
if
(
p_playlist
->
p_input
)
input_thread_t
*
p_input
=
playlist_CurrentInput
(
p_playlist
);
if
(
p_input
)
{
/*char *psz_uri =
input_item_GetURI( input_GetItem( p_playlist->p_input ) );
...
...
@@ -380,7 +386,7 @@ static int vlclua_playlist_status( lua_State *L )
free( psz_uri );
lua_pushnumber( L, config_GetInt( p_intf, "volume" ) );*/
PL_LOCK
;
switch
(
p
_playlist
->
status
.
i_status
)
switch
(
p
laylist_Status
(
p_playlist
)
)
{
case
PLAYLIST_STOPPED
:
lua_pushstring
(
L
,
"stopped"
);
...
...
@@ -397,6 +403,7 @@ static int vlclua_playlist_status( lua_State *L )
}
PL_UNLOCK
;
/*i_count += 3;*/
vlc_object_release
(
p_input
);
}
else
{
...
...
src/control/playlist.c
View file @
d228fdd2
...
...
@@ -80,7 +80,7 @@ void libvlc_playlist_play( libvlc_instance_t *p_instance, int i_id,
}
p_item
=
playlist_ItemGetByInputId
(
PL
,
i_id
,
PL
->
status
.
p_node
);
PL
->
p_root_category
);
if
(
!
p_item
)
{
if
(
did_lock
==
1
)
...
...
@@ -92,7 +92,7 @@ void libvlc_playlist_play( libvlc_instance_t *p_instance, int i_id,
}
playlist_Control
(
PL
,
PLAYLIST_VIEWPLAY
,
pl_Locked
,
PL
->
status
.
p_node
,
p_item
);
PL
->
p_root_category
,
p_item
);
if
(
did_lock
==
1
)
{
vlc_object_unlock
(
PL
);
...
...
@@ -214,8 +214,6 @@ int libvlc_playlist_get_current_index ( libvlc_instance_t *p_instance,
VLC_UNUSED
(
p_e
);
assert
(
PL
);
if
(
!
PL
->
status
.
p_item
)
return
-
1
;
return
playlist_CurrentId
(
PL
);
}
...
...
@@ -239,12 +237,12 @@ libvlc_media_player_t * libvlc_playlist_get_media_player(
{
libvlc_media_player_t
*
p_mi
;
assert
(
PL
);
vlc_object_lock
(
PL
);
if
(
PL
->
p_input
)
input_thread_t
*
input
=
playlist_CurrentInput
(
PL
);
if
(
input
)
{
p_mi
=
libvlc_media_player_new_from_input_thread
(
p_instance
,
PL
->
p_input
,
p_e
);
p_instance
,
input
,
p_e
);
vlc_object_release
(
input
);
}
else
{
...
...
@@ -252,7 +250,6 @@ libvlc_media_player_t * libvlc_playlist_get_media_player(
p_mi
=
NULL
;
libvlc_exception_raise
(
p_e
,
"No active input"
);
}
vlc_object_unlock
(
PL
);
return
p_mi
;
}
...
...
src/libvlccore.sym
View file @
d228fdd2
...
...
@@ -276,13 +276,16 @@ playlist_BothAddInput
playlist_ChildSearchName
playlist_Clear
playlist_Control
playlist_CurrentId
playlist_CurrentInput
playlist_CurrentPlayingItem
playlist_DeleteFromInput
playlist_Export
playlist_GetLastLeaf
playlist_GetNextLeaf
playlist_GetPreferredNode
playlist_GetPrevLeaf
playlist_IsPlaying
playlist_IsServicesDiscoveryLoaded
playlist_ItemGetById
playlist_ItemGetByInput
...
...
@@ -304,6 +307,7 @@ playlist_PreparseEnqueueItem
playlist_RecursiveNodeSort
playlist_ServicesDiscoveryAdd
playlist_ServicesDiscoveryRemove
playlist_Status
playlist_TreeMove
__pl_Hold
__pl_Release
...
...
src/playlist/control.c
View file @
d228fdd2
...
...
@@ -97,9 +97,9 @@ static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args
switch
(
i_query
)
{
case
PLAYLIST_STOP
:
p
_playlist
->
request
.
i_status
=
PLAYLIST_STOPPED
;
p
_playlist
->
request
.
b_request
=
true
;
p
_playlist
->
request
.
p_item
=
NULL
;
p
l_priv
(
p_playlist
)
->
request
.
i_status
=
PLAYLIST_STOPPED
;
p
l_priv
(
p_playlist
)
->
request
.
b_request
=
true
;
p
l_priv
(
p_playlist
)
->
request
.
p_item
=
NULL
;
break
;
// Node can be null, it will keep the same. Use with care ...
...
...
@@ -112,65 +112,65 @@ static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args
p_node
=
get_current_status_node
(
p_playlist
);
assert
(
p_node
);
}
p
_playlist
->
request
.
i_status
=
PLAYLIST_RUNNING
;
p
_playlist
->
request
.
i_skip
=
0
;
p
_playlist
->
request
.
b_request
=
true
;
p
_playlist
->
request
.
p_node
=
p_node
;
p
_playlist
->
request
.
p_item
=
p_item
;
p
l_priv
(
p_playlist
)
->
request
.
i_status
=
PLAYLIST_RUNNING
;
p
l_priv
(
p_playlist
)
->
request
.
i_skip
=
0
;
p
l_priv
(
p_playlist
)
->
request
.
b_request
=
true
;
p
l_priv
(
p_playlist
)
->
request
.
p_node
=
p_node
;
p
l_priv
(
p_playlist
)
->
request
.
p_item
=
p_item
;
if
(
p_item
&&
var_GetBool
(
p_playlist
,
"random"
)
)
p_playlist
->
b_reset_currently_playing
=
true
;
break
;
case
PLAYLIST_PLAY
:
if
(
p
_playlist
->
p_input
)
if
(
p
l_priv
(
p_playlist
)
->
p_input
)
{
val
.
i_int
=
PLAYING_S
;
var_Set
(
p
_playlist
->
p_input
,
"state"
,
val
);
var_Set
(
p
l_priv
(
p_playlist
)
->
p_input
,
"state"
,
val
);
break
;
}
else
{
p
_playlist
->
request
.
i_status
=
PLAYLIST_RUNNING
;
p
_playlist
->
request
.
b_request
=
true
;
p
_playlist
->
request
.
p_node
=
get_current_status_node
(
p_playlist
);
p
_playlist
->
request
.
p_item
=
get_current_status_item
(
p_playlist
);
p
_playlist
->
request
.
i_skip
=
0
;
p
l_priv
(
p_playlist
)
->
request
.
i_status
=
PLAYLIST_RUNNING
;
p
l_priv
(
p_playlist
)
->
request
.
b_request
=
true
;
p
l_priv
(
p_playlist
)
->
request
.
p_node
=
get_current_status_node
(
p_playlist
);
p
l_priv
(
p_playlist
)
->
request
.
p_item
=
get_current_status_item
(
p_playlist
);
p
l_priv
(
p_playlist
)
->
request
.
i_skip
=
0
;
}
break
;
case
PLAYLIST_PAUSE
:
val
.
i_int
=
0
;
if
(
p
_playlist
->
p_input
)
var_Get
(
p
_playlist
->
p_input
,
"state"
,
&
val
);
if
(
p
l_priv
(
p_playlist
)
->
p_input
)
var_Get
(
p
l_priv
(
p_playlist
)
->
p_input
,
"state"
,
&
val
);
if
(
val
.
i_int
==
PAUSE_S
)
{
p
_playlist
->
status
.
i_status
=
PLAYLIST_RUNNING
;
if
(
p
_playlist
->
p_input
)
p
l_priv
(
p_playlist
)
->
status
.
i_status
=
PLAYLIST_RUNNING
;
if
(
p
l_priv
(
p_playlist
)
->
p_input
)
{
val
.
i_int
=
PLAYING_S
;
var_Set
(
p
_playlist
->
p_input
,
"state"
,
val
);
var_Set
(
p
l_priv
(
p_playlist
)
->
p_input
,
"state"
,
val
);
}
}
else
{
p
_playlist
->
status
.
i_status
=
PLAYLIST_PAUSED
;
if
(
p
_playlist
->
p_input
)
p
l_priv
(
p_playlist
)
->
status
.
i_status
=
PLAYLIST_PAUSED
;
if
(
p
l_priv
(
p_playlist
)
->
p_input
)
{
val
.
i_int
=
PAUSE_S
;
var_Set
(
p
_playlist
->
p_input
,
"state"
,
val
);
var_Set
(
p
l_priv
(
p_playlist
)
->
p_input
,
"state"
,
val
);
}
}
break
;
case
PLAYLIST_SKIP
:
p
_playlist
->
request
.
p_node
=
get_current_status_node
(
p_playlist
);
p
_playlist
->
request
.
p_item
=
get_current_status_item
(
p_playlist
);
p
_playlist
->
request
.
i_skip
=
(
int
)
va_arg
(
args
,
int
);
p
l_priv
(
p_playlist
)
->
request
.
p_node
=
get_current_status_node
(
p_playlist
);
p
l_priv
(
p_playlist
)
->
request
.
p_item
=
get_current_status_item
(
p_playlist
);
p
l_priv
(
p_playlist
)
->
request
.
i_skip
=
(
int
)
va_arg
(
args
,
int
);
/* if already running, keep running */
if
(
p
_playlist
->
status
.
i_status
!=
PLAYLIST_STOPPED
)
p
_playlist
->
request
.
i_status
=
p_playlist
->
status
.
i_status
;
p
_playlist
->
request
.
b_request
=
true
;
if
(
p
l_priv
(
p_playlist
)
->
status
.
i_status
!=
PLAYLIST_STOPPED
)
p
l_priv
(
p_playlist
)
->
request
.
i_status
=
pl_priv
(
p_playlist
)
->
status
.
i_status
;
p
l_priv
(
p_playlist
)
->
request
.
b_request
=
true
;
break
;
default:
...
...
@@ -291,14 +291,14 @@ void ResetCurrentlyPlaying( playlist_t *p_playlist, bool b_random,
stats_TimerStart
(
p_playlist
,
"Items array build"
,
STATS_TIMER_PLAYLIST_BUILD
);
PL_DEBUG
(
"rebuilding array of current - root %s"
,
PLI_NAME
(
p
_playlist
->
status
.
p_node
)
);
PLI_NAME
(
p
l_priv
(
p_playlist
)
->
status
.
p_node
)
);
ARRAY_RESET
(
p_playlist
->
current
);
p_playlist
->
i_current_index
=
-
1
;
while
(
1
)
{
/** FIXME: this is *slow* */
p_next
=
playlist_GetNextLeaf
(
p_playlist
,
p
_playlist
->
status
.
p_node
,
p
l_priv
(
p_playlist
)
->
status
.
p_node
,
p_next
,
true
,
false
);
if
(
p_next
)
{
...
...
@@ -355,19 +355,19 @@ playlist_item_t * playlist_NextItem( playlist_t *p_playlist )
}
/* Repeat and play/stop */
if
(
!
p
_playlist
->
request
.
b_request
&&
b_repeat
==
true
&&
if
(
!
p
l_priv
(
p_playlist
)
->
request
.
b_request
&&
b_repeat
==
true
&&
get_current_status_item
(
p_playlist
)
)
{
msg_Dbg
(
p_playlist
,
"repeating item"
);
return
get_current_status_item
(
p_playlist
);
}
if
(
!
p
_playlist
->
request
.
b_request
&&
b_playstop
==
true
)
if
(
!
p
l_priv
(
p_playlist
)
->
request
.
b_request
&&
b_playstop
==
true
)
{
msg_Dbg
(
p_playlist
,
"stopping (play and stop)"
);
return
NULL
;
}
if
(
!
p
_playlist
->
request
.
b_request
&&
if
(
!
p
l_priv
(
p_playlist
)
->
request
.
b_request
&&
get_current_status_item
(
p_playlist
)
)
{
playlist_item_t
*
p_parent
=
get_current_status_item
(
p_playlist
);
...
...
@@ -383,20 +383,20 @@ playlist_item_t * playlist_NextItem( playlist_t *p_playlist )
}
/* Start the real work */
if
(
p
_playlist
->
request
.
b_request
)
if
(
p
l_priv
(
p_playlist
)
->
request
.
b_request
)
{
p_new
=
p
_playlist
->
request
.
p_item
;
i_skip
=
p
_playlist
->
request
.
i_skip
;
p_new
=
p
l_priv
(
p_playlist
)
->
request
.
p_item
;
i_skip
=
p
l_priv
(
p_playlist
)
->
request
.
i_skip
;
PL_DEBUG
(
"processing request item %s node %s skip %i"
,
PLI_NAME
(
p
_playlist
->
request
.
p_item
),
PLI_NAME
(
p
_playlist
->
request
.
p_node
),
i_skip
);
PLI_NAME
(
p
l_priv
(
p_playlist
)
->
request
.
p_item
),
PLI_NAME
(
p
l_priv
(
p_playlist
)
->
request
.
p_node
),
i_skip
);
if
(
p
_playlist
->
request
.
p_node
&&
p
_playlist
->
request
.
p_node
!=
get_current_status_node
(
p_playlist
)
)
if
(
p
l_priv
(
p_playlist
)
->
request
.
p_node
&&
p
l_priv
(
p_playlist
)
->
request
.
p_node
!=
get_current_status_node
(
p_playlist
)
)
{
set_current_status_node
(
p_playlist
,
p
_playlist
->
request
.
p_node
);
p
_playlist
->
request
.
p_node
=
NULL
;
set_current_status_node
(
p_playlist
,
p
l_priv
(
p_playlist
)
->
request
.
p_node
);
p
l_priv
(
p_playlist
)
->
request
.
p_node
=
NULL
;
p_playlist
->
b_reset_currently_playing
=
true
;
}
...
...
@@ -457,7 +457,7 @@ playlist_item_t * playlist_NextItem( playlist_t *p_playlist )
p_playlist
->
i_current_index
);
}
/* Clear the request */
p
_playlist
->
request
.
b_request
=
false
;
p
l_priv
(
p_playlist
)
->
request
.
b_request
=
false
;
}
/* "Automatic" item change ( next ) */
else
...
...
@@ -509,7 +509,7 @@ int playlist_PlayItem( playlist_t *p_playlist, playlist_item_t *p_item )
p_input
->
i_nb_played
++
;
set_current_status_item
(
p_playlist
,
p_item
);
p
_playlist
->
status
.
i_status
=
PLAYLIST_RUNNING
;
p
l_priv
(
p_playlist
)
->
status
.
i_status
=
PLAYLIST_RUNNING
;
var_SetInteger
(
p_playlist
,
"activity"
,
i_activity
+
DEFAULT_INPUT_ACTIVITY
);
...
...
src/playlist/engine.c
View file @
d228fdd2
This diff is collapsed.
Click to expand it.
src/playlist/item.c
View file @
d228fdd2
...
...
@@ -852,12 +852,12 @@ static void GoAndPreparse( playlist_t *p_playlist, int i_mode,
p_parent
=
p_parent
->
p_parent
;
}
assert
(
p_toplay
);
p
_playlist
->
request
.
b_request
=
true
;
p
_playlist
->
request
.
i_skip
=
0
;
p
_playlist
->
request
.
p_item
=
p_toplay
;
if
(
p
_playlist
->
p_input
)
input_StopThread
(
p
_playlist
->
p_input
);
p
_playlist
->
request
.
i_status
=
PLAYLIST_RUNNING
;
p
l_priv
(
p_playlist
)
->
request
.
b_request
=
true
;
p
l_priv
(
p_playlist
)
->
request
.
i_skip
=
0
;
p
l_priv
(
p_playlist
)
->
request
.
p_item
=
p_toplay
;
if
(
p
l_priv
(
p_playlist
)
->
p_input
)
input_StopThread
(
p
l_priv
(
p_playlist
)
->
p_input
);
p
l_priv
(
p_playlist
)
->
request
.
i_status
=
PLAYLIST_RUNNING
;
vlc_object_signal_unlocked
(
p_playlist
);
}
/* Preparse if PREPARSE or SPREPARSE & not enough meta */
...
...
@@ -937,9 +937,9 @@ static int DeleteInner( playlist_t * p_playlist, playlist_item_t *p_item,
/* Hack we don't call playlist_Control for lock reasons */
if
(
b_stop
)
{
p
_playlist
->
request
.
i_status
=
PLAYLIST_STOPPED
;
p
_playlist
->
request
.
b_request
=
true
;
p
_playlist
->
request
.
p_item
=
NULL
;
p
l_priv
(
p_playlist
)
->
request
.
i_status
=
PLAYLIST_STOPPED
;
p
l_priv
(
p_playlist
)
->
request
.
b_request
=
true
;
p
l_priv
(
p_playlist
)
->
request
.
p_item
=
NULL
;
msg_Info
(
p_playlist
,
"stopping playback"
);
vlc_object_signal_unlocked
(
VLC_OBJECT
(
p_playlist
)
);
}
...
...
src/playlist/playlist_internal.h
View file @
d228fdd2
...
...
@@ -66,6 +66,38 @@ typedef struct playlist_private_t
playlist_preparse_t
preparse
;
/**< Preparser data */
playlist_fetcher_t
fetcher
;
/**< Meta and art fetcher data */
sout_instance_t
*
p_sout
;
/**< Kept sout instance */
struct
playlist_services_discovery_support_t
{
/* the playlist items for category and onelevel */
playlist_item_t
*
p_cat
;
playlist_item_t
*
p_one
;
services_discovery_t
*
p_sd
;
/**< Loaded service discovery modules */
}
**
pp_sds
;
int
i_sds
;
/**< Number of service discovery modules */
input_thread_t
*
p_input
;
/**< the input thread associated
* with the current item */
struct
{
/* Current status. These fields are readonly, only the playlist
* main loop can touch it*/
playlist_status_t
i_status
;
/**< Current status of playlist */
playlist_item_t
*
p_item
;
/**< Currently playing/active item */
playlist_item_t
*
p_node
;
/**< Current node to play from */
}
status
;
struct
{
/* Request. Use this to give orders to the playlist main loop */
playlist_status_t
i_status
;
/**< requested playlist status */
playlist_item_t
*
p_node
;
/**< requested node to play from */
playlist_item_t
*
p_item
;
/**< requested item to play in the node */
int
i_skip
;
/**< Number of items to skip */
bool
b_request
;
/**< Set to true by the requester
The playlist sets it back to false
when processing the request */
vlc_mutex_t
lock
;
/**< Lock to protect request */
}
request
;
}
playlist_private_t
;
#define pl_priv( pl ) ((playlist_private_t *)(pl))
...
...
src/playlist/services_discovery.c
View file @
d228fdd2
...
...
@@ -356,7 +356,7 @@ int playlist_ServicesDiscoveryAdd( playlist_t *p_playlist, const char *psz_modu
p_sds
->
p_cat
=
p_cat
;
PL_LOCK
;
TAB_APPEND
(
p
_playlist
->
i_sds
,
p_playlist
->
pp_sds
,
p_sds
);
TAB_APPEND
(
p
l_priv
(
p_playlist
)
->
i_sds
,
pl_priv
(
p_playlist
)
->
pp_sds
,
p_sds
);
PL_UNLOCK
;
}
...
...
@@ -371,12 +371,12 @@ int playlist_ServicesDiscoveryRemove( playlist_t * p_playlist,
int
i
;
PL_LOCK
;
for
(
i
=
0
;
i
<
p
_playlist
->
i_sds
;
i
++
)
for
(
i
=
0
;
i
<
p
l_priv
(
p_playlist
)
->
i_sds
;
i
++
)
{
if
(
!
strcmp
(
psz_module
,
p
_playlist
->
pp_sds
[
i
]
->
p_sd
->
psz_module
)
)
if
(
!
strcmp
(
psz_module
,
p
l_priv
(
p_playlist
)
->
pp_sds
[
i
]
->
p_sd
->
psz_module
)
)
{
p_sds
=
p
_playlist
->
pp_sds
[
i
];
REMOVE_ELEM
(
p
_playlist
->
pp_sds
,
p_playlist
->
i_sds
,
i
);
p_sds
=
p
l_priv
(
p_playlist
)
->
pp_sds
[
i
];
REMOVE_ELEM
(
p
l_priv
(
p_playlist
)
->
pp_sds
,
pl_priv
(
p_playlist
)
->
i_sds
,
i
);
break
;
}
}
...
...
@@ -430,9 +430,9 @@ bool playlist_IsServicesDiscoveryLoaded( playlist_t * p_playlist,
int
i
;
PL_LOCK
;
for
(
i
=
0
;
i
<
p
_playlist
->
i_sds
;
i
++
)
for
(
i
=
0
;
i
<
p
l_priv
(
p_playlist
)
->
i_sds
;
i
++
)
{
if
(
!
strcmp
(
psz_module
,
p
_playlist
->
pp_sds
[
i
]
->
p_sd
->
psz_module
)
)
if
(
!
strcmp
(
psz_module
,
p
l_priv
(
p_playlist
)
->
pp_sds
[
i
]
->
p_sd
->
psz_module
)
)
{
PL_UNLOCK
;
return
true
;
...
...
@@ -444,7 +444,7 @@ bool playlist_IsServicesDiscoveryLoaded( playlist_t * p_playlist,
void
playlist_ServicesDiscoveryKillAll
(
playlist_t
*
p_playlist
)
{
while
(
p
_playlist
->
i_sds
>
0
)
while
(
p
l_priv
(
p_playlist
)
->
i_sds
>
0
)
playlist_ServicesDiscoveryRemove
(
p_playlist
,
p
_playlist
->
pp_sds
[
0
]
->
p_sd
->
psz_module
);
p
l_priv
(
p_playlist
)
->
pp_sds
[
0
]
->
p_sd
->
psz_module
);
}
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