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
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
Show 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 )
...
@@ -476,8 +476,12 @@ int playlist_PlayItem( playlist_t *p_playlist, playlist_item_t *p_item )
var_SetInteger
(
p_playlist
,
"activity"
,
i_activity
+
var_SetInteger
(
p_playlist
,
"activity"
,
i_activity
+
DEFAULT_INPUT_ACTIVITY
);
DEFAULT_INPUT_ACTIVITY
);
p_playlist
->
p_input
=
input_thread_t
*
p_input_thread
=
input_CreateThreadExtended
(
p_playlist
,
p_input
,
NULL
,
*
pp_sout
);
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
;
*
pp_sout
=
NULL
;
char
*
psz_uri
=
input_item_GetURI
(
p_item
->
p_input
);
char
*
psz_uri
=
input_item_GetURI
(
p_item
->
p_input
);
...
...
src/playlist/engine.c
View file @
966feba1
...
@@ -39,6 +39,7 @@
...
@@ -39,6 +39,7 @@
*****************************************************************************/
*****************************************************************************/
static
void
VariablesInit
(
playlist_t
*
p_playlist
);
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
void
playlist_Destructor
(
vlc_object_t
*
p_this
);
static
int
RandomCallback
(
vlc_object_t
*
p_this
,
char
const
*
psz_cmd
,
static
int
RandomCallback
(
vlc_object_t
*
p_this
,
char
const
*
psz_cmd
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
a
)
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
a
)
...
@@ -244,19 +245,13 @@ check_input:
...
@@ -244,19 +245,13 @@ check_input:
PL_DEBUG
(
"dead input"
);
PL_DEBUG
(
"dead input"
);
p_input
=
p_playlist
->
p_input
;
p_input
=
p_playlist
->
p_input
;
p_playlist
->
p_input
=
NULL
;
assert
(
*
pp_sout
==
NULL
);
assert
(
*
pp_sout
==
NULL
);
if
(
var_CreateGetBool
(
p_input
,
"sout-keep"
)
)
if
(
var_CreateGetBool
(
p_input
,
"sout-keep"
)
)
*
pp_sout
=
input_DetachSout
(
p_input
);
*
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 */
/* Destroy input */
vlc_object_release
(
p_input
);
playlist_release_current_input
(
p_playlist
);
PL_LOCK
;
p_playlist
->
gc_date
=
mdate
();
p_playlist
->
gc_date
=
mdate
();
p_playlist
->
b_cant_sleep
=
true
;
p_playlist
->
b_cant_sleep
=
true
;
...
@@ -275,6 +270,7 @@ check_input:
...
@@ -275,6 +270,7 @@ check_input:
i_activity
=
var_GetInteger
(
p_playlist
,
"activity"
);
i_activity
=
var_GetInteger
(
p_playlist
,
"activity"
);
var_SetInteger
(
p_playlist
,
"activity"
,
i_activity
-
var_SetInteger
(
p_playlist
,
"activity"
,
i_activity
-
DEFAULT_INPUT_ACTIVITY
);
DEFAULT_INPUT_ACTIVITY
);
goto
check_input
;
goto
check_input
;
}
}
/* This input is dying, let it do */
/* This input is dying, let it do */
...
@@ -378,18 +374,13 @@ void playlist_LastLoop( playlist_t *p_playlist )
...
@@ -378,18 +374,13 @@ void playlist_LastLoop( playlist_t *p_playlist )
if
(
p_playlist
->
p_input
->
b_dead
)
if
(
p_playlist
->
p_input
->
b_dead
)
{
{
input_thread_t
*
p_input
;
/* remove input */
playlist_release_current_input
(
p_playlist
);
/* Unlink current input */
p_input
=
p_playlist
->
p_input
;
p_playlist
->
p_input
=
NULL
;
PL_UNLOCK
;
/* sout-keep: no need to anything here.
/* sout-keep: no need to anything here.
* The last input will destroy its sout, if any, by itself */
* The last input will destroy its sout, if any, by itself */
/* Destroy input */
PL_UNLOCK
;
vlc_object_release
(
p_input
);
continue
;
continue
;
}
}
else
if
(
p_playlist
->
p_input
->
b_die
)
else
if
(
p_playlist
->
p_input
->
b_die
)
...
...
src/playlist/playlist_internal.h
View file @
966feba1
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
*/
*/
#include "input/input_internal.h"
#include "input/input_internal.h"
#include <assert.h>
struct
playlist_preparse_t
struct
playlist_preparse_t
{
{
...
@@ -109,6 +110,37 @@ playlist_item_t *playlist_ItemFindFromInputAndRoot( playlist_t *p_playlist,
...
@@ -109,6 +110,37 @@ playlist_item_t *playlist_ItemFindFromInputAndRoot( playlist_t *p_playlist,
int
playlist_DeleteFromItemId
(
playlist_t
*
,
int
);
int
playlist_DeleteFromItemId
(
playlist_t
*
,
int
);
int
playlist_ItemDelete
(
playlist_item_t
*
);
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