Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
966feba1
Commit
966feba1
authored
Jun 14, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist: Use a set/release accessor for playlist->p_input.
(To better track when to attach/detach events).
parent
c75d563f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
17 deletions
+44
-17
src/playlist/control.c
src/playlist/control.c
+5
-1
src/playlist/engine.c
src/playlist/engine.c
+7
-16
src/playlist/playlist_internal.h
src/playlist/playlist_internal.h
+32
-0
No files found.
src/playlist/control.c
View file @
966feba1
...
...
@@ -476,8 +476,12 @@ int playlist_PlayItem( playlist_t *p_playlist, playlist_item_t *p_item )
var_SetInteger
(
p_playlist
,
"activity"
,
i_activity
+
DEFAULT_INPUT_ACTIVITY
);
p_playlist
->
p_input
=
input_thread_t
*
p_input_thread
=
input_CreateThreadExtended
(
p_playlist
,
p_input
,
NULL
,
*
pp_sout
);
playlist_set_current_input
(
p_playlist
,
p_input_thread
);
vlc_object_release
(
p_input_thread
);
*
pp_sout
=
NULL
;
char
*
psz_uri
=
input_item_GetURI
(
p_item
->
p_input
);
...
...
src/playlist/engine.c
View file @
966feba1
...
...
@@ -39,6 +39,7 @@
*****************************************************************************/
static
void
VariablesInit
(
playlist_t
*
p_playlist
);
static
void
playlist_Destructor
(
vlc_object_t
*
p_this
);
static
void
playlist_Destructor
(
vlc_object_t
*
p_this
);
static
int
RandomCallback
(
vlc_object_t
*
p_this
,
char
const
*
psz_cmd
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
a
)
...
...
@@ -244,19 +245,13 @@ check_input:
PL_DEBUG
(
"dead input"
);
p_input
=
p_playlist
->
p_input
;
p_playlist
->
p_input
=
NULL
;
assert
(
*
pp_sout
==
NULL
);
if
(
var_CreateGetBool
(
p_input
,
"sout-keep"
)
)
*
pp_sout
=
input_DetachSout
(
p_input
);
/* Release the playlist lock, because we may get stuck
* in vlc_object_release() for some time. */
PL_UNLOCK
;
/* Destroy input */
vlc_object_release
(
p_input
);
PL_LOCK
;
playlist_release_current_input
(
p_playlist
);
p_playlist
->
gc_date
=
mdate
();
p_playlist
->
b_cant_sleep
=
true
;
...
...
@@ -275,6 +270,7 @@ check_input:
i_activity
=
var_GetInteger
(
p_playlist
,
"activity"
);
var_SetInteger
(
p_playlist
,
"activity"
,
i_activity
-
DEFAULT_INPUT_ACTIVITY
);
goto
check_input
;
}
/* This input is dying, let it do */
...
...
@@ -378,18 +374,13 @@ void playlist_LastLoop( playlist_t *p_playlist )
if
(
p_playlist
->
p_input
->
b_dead
)
{
input_thread_t
*
p_input
;
/* Unlink current input */
p_input
=
p_playlist
->
p_input
;
p_playlist
->
p_input
=
NULL
;
PL_UNLOCK
;
/* remove input */
playlist_release_current_input
(
p_playlist
);
/* sout-keep: no need to anything here.
* The last input will destroy its sout, if any, by itself */
/* Destroy input */
vlc_object_release
(
p_input
);
PL_UNLOCK
;
continue
;
}
else
if
(
p_playlist
->
p_input
->
b_die
)
...
...
src/playlist/playlist_internal.h
View file @
966feba1
...
...
@@ -35,6 +35,7 @@
*/
#include "input/input_internal.h"
#include <assert.h>
struct
playlist_preparse_t
{
...
...
@@ -109,6 +110,37 @@ playlist_item_t *playlist_ItemFindFromInputAndRoot( playlist_t *p_playlist,
int
playlist_DeleteFromItemId
(
playlist_t
*
,
int
);
int
playlist_ItemDelete
(
playlist_item_t
*
);
static
inline
void
playlist_release_current_input
(
playlist_t
*
p_playlist
)
{
vlc_assert_locked
(
&
p_playlist
->
object_lock
);
if
(
!
p_playlist
->
p_input
)
return
;
input_thread_t
*
p_input
=
p_playlist
->
p_input
;
p_playlist
->
p_input
=
NULL
;
/* Release the playlist lock, because we may get stuck
* in vlc_object_release() for some time. */
PL_UNLOCK
;
vlc_object_release
(
p_input
);
PL_LOCK
;
}
static
inline
void
playlist_set_current_input
(
playlist_t
*
p_playlist
,
input_thread_t
*
p_input
)
{
vlc_assert_locked
(
&
p_playlist
->
object_lock
);
playlist_release_current_input
(
p_playlist
);
if
(
p_input
)
{
vlc_object_yield
(
p_input
);
p_playlist
->
p_input
=
p_input
;
}
}
/**
* @}
*/
...
...
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