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
2dfe5574
Commit
2dfe5574
authored
Jan 31, 2010
by
Jakob Leben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist: make playlist_DeleteFromInput delete container nodes as well
and refactor playlist code for optimization
parent
22b2b54f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
23 deletions
+9
-23
src/playlist/item.c
src/playlist/item.c
+7
-21
src/playlist/playlist_internal.h
src/playlist/playlist_internal.h
+1
-0
src/playlist/tree.c
src/playlist/tree.c
+1
-2
No files found.
src/playlist/item.c
View file @
2dfe5574
...
...
@@ -35,8 +35,6 @@ static void AddItem( playlist_t *p_playlist, playlist_item_t *p_item,
static
void
GoAndPreparse
(
playlist_t
*
p_playlist
,
int
i_mode
,
playlist_item_t
*
,
playlist_item_t
*
);
static
void
ChangeToNode
(
playlist_t
*
p_playlist
,
playlist_item_t
*
p_item
);
static
int
DeleteInner
(
playlist_t
*
p_playlist
,
playlist_item_t
*
p_item
,
bool
b_stop
);
static
playlist_item_t
*
ItemToNode
(
playlist_t
*
,
playlist_item_t
*
,
bool
);
...
...
@@ -239,24 +237,11 @@ int playlist_ItemRelease( playlist_item_t *p_item )
static
int
DeleteFromInput
(
playlist_t
*
p_playlist
,
input_item_t
*
p_input
,
playlist_item_t
*
p_root
,
bool
b_do_stop
)
{
int
i
;
PL_ASSERT_LOCKED
;
for
(
i
=
0
;
i
<
p_root
->
i_children
;
i
++
)
{
if
(
p_root
->
pp_children
[
i
]
->
i_children
==
-
1
&&
p_root
->
pp_children
[
i
]
->
p_input
==
p_input
)
{
DeleteInner
(
p_playlist
,
p_root
->
pp_children
[
i
],
b_do_stop
);
return
VLC_SUCCESS
;
}
else
if
(
p_root
->
pp_children
[
i
]
->
i_children
>=
0
)
{
int
i_ret
=
DeleteFromInput
(
p_playlist
,
p_input
,
p_root
->
pp_children
[
i
],
b_do_stop
);
if
(
i_ret
==
VLC_SUCCESS
)
return
VLC_SUCCESS
;
}
}
return
VLC_EGENERIC
;
playlist_item_t
*
p_item
=
playlist_ItemFindFromInputAndRoot
(
p_playlist
,
p_input
,
p_root
,
false
);
if
(
!
p_item
)
return
VLC_EGENERIC
;
return
playlist_DeleteItem
(
p_playlist
,
p_item
,
b_do_stop
);
}
/**
...
...
@@ -332,7 +317,7 @@ int playlist_DeleteFromItemId( playlist_t *p_playlist, int i_id )
PL_ASSERT_LOCKED
;
playlist_item_t
*
p_item
=
playlist_ItemGetById
(
p_playlist
,
i_id
);
if
(
!
p_item
)
return
VLC_EGENERIC
;
return
DeleteInner
(
p_playlist
,
p_item
,
true
);
return
playlist_DeleteItem
(
p_playlist
,
p_item
,
true
);
}
/***************************************************************************
...
...
@@ -880,7 +865,7 @@ static void ChangeToNode( playlist_t *p_playlist, playlist_item_t *p_item )
}
/* Do the actual removal */
static
int
DeleteInner
(
playlist_t
*
p_playlist
,
playlist_item_t
*
p_item
,
int
playlist_DeleteItem
(
playlist_t
*
p_playlist
,
playlist_item_t
*
p_item
,
bool
b_stop
)
{
int
i
;
...
...
@@ -891,6 +876,7 @@ static int DeleteInner( playlist_t * p_playlist, playlist_item_t *p_item,
{
return
playlist_NodeDelete
(
p_playlist
,
p_item
,
true
,
false
);
}
pl_priv
(
p_playlist
)
->
b_reset_currently_playing
=
true
;
var_SetInteger
(
p_playlist
,
"playlist-item-deleted"
,
i_id
);
...
...
src/playlist/playlist_internal.h
View file @
2dfe5574
...
...
@@ -145,6 +145,7 @@ int playlist_ItemRelease( playlist_item_t * );
void
playlist_NodesPairCreate
(
playlist_t
*
,
const
char
*
,
playlist_item_t
**
,
playlist_item_t
**
,
bool
);
int
playlist_NodeEmpty
(
playlist_t
*
,
playlist_item_t
*
,
bool
);
int
playlist_DeleteItem
(
playlist_t
*
p_playlist
,
playlist_item_t
*
,
bool
);
/**
...
...
src/playlist/tree.c
View file @
2dfe5574
...
...
@@ -153,8 +153,7 @@ int playlist_NodeDelete( playlist_t *p_playlist, playlist_item_t *p_root,
}
else
if
(
b_delete_items
)
{
playlist_DeleteFromItemId
(
p_playlist
,
p_root
->
pp_children
[
i
]
->
i_id
);
playlist_DeleteItem
(
p_playlist
,
p_root
->
pp_children
[
i
],
true
);
}
}
/* Delete the node */
...
...
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