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
2d970fe0
Commit
2d970fe0
authored
Jun 10, 2007
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Call garbage collector (vout/sout) when playlist enter stop state (on
user stop or end of playlist).
parent
ac586317
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
src/playlist/engine.c
src/playlist/engine.c
+17
-10
No files found.
src/playlist/engine.c
View file @
2d970fe0
...
@@ -178,23 +178,26 @@ void playlist_Destroy( playlist_t *p_playlist )
...
@@ -178,23 +178,26 @@ void playlist_Destroy( playlist_t *p_playlist )
}
}
/* Destroy remaining objects */
/* Destroy remaining objects */
static
void
ObjectGarbageCollector
(
playlist_t
*
p_playlist
)
static
void
ObjectGarbageCollector
(
playlist_t
*
p_playlist
,
vlc_bool_t
b_force
)
{
{
vlc_object_t
*
p_obj
;
vlc_object_t
*
p_obj
;
if
(
mdate
()
-
p_playlist
->
gc_date
<
1000000
)
if
(
!
b_force
)
{
{
p_playlist
->
b_cant_sleep
=
VLC_TRUE
;
if
(
mdate
()
-
p_playlist
->
gc_date
<
1000000
)
return
;
{
p_playlist
->
b_cant_sleep
=
VLC_TRUE
;
return
;
}
else
if
(
p_playlist
->
gc_date
==
0
)
return
;
}
}
else
if
(
p_playlist
->
gc_date
==
0
)
return
;
vlc_mutex_lock
(
&
p_playlist
->
gc_lock
);
vlc_mutex_lock
(
&
p_playlist
->
gc_lock
);
while
(
(
p_obj
=
vlc_object_find
(
p_playlist
,
VLC_OBJECT_VOUT
,
while
(
(
p_obj
=
vlc_object_find
(
p_playlist
,
VLC_OBJECT_VOUT
,
FIND_CHILD
)
)
)
FIND_CHILD
)
)
)
{
{
if
(
p_obj
->
p_parent
!=
(
vlc_object_t
*
)
p_playlist
)
if
(
p_obj
->
p_parent
!=
VLC_OBJECT
(
p_playlist
)
)
{
{
vlc_object_release
(
p_obj
);
vlc_object_release
(
p_obj
);
break
;
break
;
...
@@ -207,7 +210,7 @@ static void ObjectGarbageCollector( playlist_t *p_playlist )
...
@@ -207,7 +210,7 @@ static void ObjectGarbageCollector( playlist_t *p_playlist )
while
(
(
p_obj
=
vlc_object_find
(
p_playlist
,
VLC_OBJECT_SOUT
,
while
(
(
p_obj
=
vlc_object_find
(
p_playlist
,
VLC_OBJECT_SOUT
,
FIND_CHILD
)
)
)
FIND_CHILD
)
)
)
{
{
if
(
p_obj
->
p_parent
!=
(
vlc_object_t
*
)
p_playlist
)
if
(
p_obj
->
p_parent
!=
VLC_OBJECT
(
p_playlist
)
)
{
{
vlc_object_release
(
p_obj
);
vlc_object_release
(
p_obj
);
break
;
break
;
...
@@ -305,7 +308,7 @@ check_input:
...
@@ -305,7 +308,7 @@ check_input:
else
if
(
p_playlist
->
p_input
->
i_state
!=
INIT_S
)
else
if
(
p_playlist
->
p_input
->
i_state
!=
INIT_S
)
{
{
PL_UNLOCK
;
PL_UNLOCK
;
ObjectGarbageCollector
(
p_playlist
);
ObjectGarbageCollector
(
p_playlist
,
VLC_FALSE
);
PL_LOCK
;
PL_LOCK
;
}
}
}
}
...
@@ -335,12 +338,16 @@ check_input:
...
@@ -335,12 +338,16 @@ check_input:
}
}
p_playlist
->
status
.
i_status
=
PLAYLIST_STOPPED
;
p_playlist
->
status
.
i_status
=
PLAYLIST_STOPPED
;
PL_UNLOCK
PL_UNLOCK
ObjectGarbageCollector
(
p_playlist
,
VLC_TRUE
);
return
;
return
;
}
}
playlist_PlayItem
(
p_playlist
,
p_item
);
playlist_PlayItem
(
p_playlist
,
p_item
);
}
}
else
else
{
{
const
vlc_bool_t
b_gc_forced
=
p_playlist
->
status
.
i_status
!=
PLAYLIST_STOPPED
;
p_playlist
->
status
.
i_status
=
PLAYLIST_STOPPED
;
p_playlist
->
status
.
i_status
=
PLAYLIST_STOPPED
;
if
(
p_playlist
->
status
.
p_item
&&
if
(
p_playlist
->
status
.
p_item
&&
p_playlist
->
status
.
p_item
->
i_flags
&
PLAYLIST_REMOVE_FLAG
)
p_playlist
->
status
.
p_item
->
i_flags
&
PLAYLIST_REMOVE_FLAG
)
...
@@ -352,7 +359,7 @@ check_input:
...
@@ -352,7 +359,7 @@ check_input:
/* Collect garbage */
/* Collect garbage */
PL_UNLOCK
;
PL_UNLOCK
;
ObjectGarbageCollector
(
p_playlist
);
ObjectGarbageCollector
(
p_playlist
,
b_gc_forced
);
PL_LOCK
;
PL_LOCK
;
}
}
}
}
...
...
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