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
24298341
Commit
24298341
authored
Jul 06, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist: Make sure we don't crash when we delete the currently playing node.
parent
c8759b8d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
1 deletion
+41
-1
src/playlist/control.c
src/playlist/control.c
+14
-0
src/playlist/engine.c
src/playlist/engine.c
+9
-0
src/playlist/tree.c
src/playlist/tree.c
+18
-1
No files found.
src/playlist/control.c
View file @
24298341
...
...
@@ -373,9 +373,23 @@ playlist_item_t * playlist_NextItem( playlist_t *p_playlist )
PLI_NAME
(
p_playlist
->
request
.
p_item
),
PLI_NAME
(
p_playlist
->
request
.
p_node
),
i_skip
);
/* Make sure the node wasn't deleted */
if
(
p_playlist
->
status
.
p_node
&&
p_playlist
->
status
.
p_node
->
i_flags
&
PLAYLIST_REMOVE_FLAG
)
{
PL_DEBUG
(
"%s was marked for deletion, deleting"
,
PLI_NAME
(
p_playlist
->
status
.
p_node
)
);
playlist_ItemDelete
(
p_playlist
->
status
.
p_node
);
/* Don't attempt to reuse that node */
if
(
p_playlist
->
status
.
p_node
==
p_playlist
->
request
.
p_node
)
p_playlist
->
request
.
p_node
=
NULL
;
p_playlist
->
status
.
p_node
=
NULL
;
}
if
(
p_playlist
->
request
.
p_node
&&
p_playlist
->
request
.
p_node
!=
p_playlist
->
status
.
p_node
)
{
p_playlist
->
status
.
p_node
=
p_playlist
->
request
.
p_node
;
p_playlist
->
b_reset_currently_playing
=
true
;
}
...
...
src/playlist/engine.c
View file @
24298341
...
...
@@ -477,6 +477,15 @@ void playlist_LastLoop( playlist_t *p_playlist )
sout_DeleteInstance
(
p_sout
);
#endif
if
(
p_playlist
->
status
.
p_node
&&
p_playlist
->
status
.
p_node
->
i_flags
&
PLAYLIST_REMOVE_FLAG
)
{
PL_DEBUG
(
"%s was marked for deletion, deleting"
,
PLI_NAME
(
p_playlist
->
status
.
p_node
)
);
playlist_ItemDelete
(
p_playlist
->
status
.
p_node
);
p_playlist
->
status
.
p_node
=
NULL
;
}
/* Core should have terminated all SDs before the playlist */
/* TODO: It fails to do so when not playing anything -- Courmisch */
playlist_ServicesDiscoveryKillAll
(
p_playlist
);
...
...
src/playlist/tree.c
View file @
24298341
...
...
@@ -171,7 +171,24 @@ int playlist_NodeDelete( playlist_t *p_playlist, playlist_item_t *p_root,
if
(
p_root
->
p_parent
)
playlist_NodeRemoveItem
(
p_playlist
,
p_root
,
p_root
->
p_parent
);
playlist_ItemDelete
(
p_root
);
/* Check if it is the current node */
if
(
p_playlist
->
status
.
p_node
==
p_root
)
{
/* Hack we don't call playlist_Control for lock reasons */
p_playlist
->
request
.
i_status
=
PLAYLIST_STOPPED
;
p_playlist
->
request
.
b_request
=
true
;
p_playlist
->
request
.
p_item
=
NULL
;
p_playlist
->
request
.
p_node
=
NULL
;
msg_Info
(
p_playlist
,
"stopping playback"
);
vlc_object_signal_maybe
(
VLC_OBJECT
(
p_playlist
)
);
PL_DEBUG
(
"marking %s for further deletion"
,
PLI_NAME
(
p_root
)
);
p_root
->
i_flags
|=
PLAYLIST_REMOVE_FLAG
;
}
else
playlist_ItemDelete
(
p_root
);
}
return
VLC_SUCCESS
;
}
...
...
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