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
22b2b54f
Commit
22b2b54f
authored
Jan 31, 2010
by
Jakob Leben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist: only install input item event callbacks on items under category root
parent
07e20e1b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
10 deletions
+15
-10
include/vlc_playlist.h
include/vlc_playlist.h
+1
-0
src/playlist/item.c
src/playlist/item.c
+11
-8
src/playlist/playlist_internal.h
src/playlist/playlist_internal.h
+2
-1
src/playlist/tree.c
src/playlist/tree.c
+1
-1
No files found.
include/vlc_playlist.h
View file @
22b2b54f
...
...
@@ -153,6 +153,7 @@ struct playlist_item_t
int
i_id
;
/**< Playlist item specific id */
uint8_t
i_flags
;
/**< Flags */
playlist_t
*
p_playlist
;
/**< Parent playlist */
bool
b_input_item_observer
;
};
#define PLAYLIST_SAVE_FLAG 0x0001
/**< Must it be saved */
...
...
src/playlist/item.c
View file @
22b2b54f
...
...
@@ -171,7 +171,7 @@ static void uninstall_input_item_observer( playlist_item_t * p_item )
* Playlist item creation
*****************************************************************************/
playlist_item_t
*
playlist_ItemNewFromInput
(
playlist_t
*
p_playlist
,
input_item_t
*
p_input
)
input_item_t
*
p_input
,
bool
install_observer
)
{
playlist_item_t
*
p_item
=
malloc
(
sizeof
(
playlist_item_t
)
);
if
(
!
p_item
)
...
...
@@ -189,8 +189,10 @@ playlist_item_t *playlist_ItemNewFromInput( playlist_t *p_playlist,
p_item
->
pp_children
=
NULL
;
p_item
->
i_flags
=
0
;
p_item
->
p_playlist
=
p_playlist
;
p_item
->
b_input_item_observer
=
install_observer
;
install_input_item_observer
(
p_item
);
if
(
install_observer
)
install_input_item_observer
(
p_item
);
return
p_item
;
}
...
...
@@ -218,7 +220,8 @@ int playlist_ItemRelease( playlist_item_t *p_item )
* Most of the modules does that.
*
* Who wants to add proper memory management? */
uninstall_input_item_observer
(
p_item
);
if
(
p_item
->
b_input_item_observer
)
uninstall_input_item_observer
(
p_item
);
ARRAY_APPEND
(
pl_priv
(
p_playlist
)
->
items_to_delete
,
p_item
);
return
VLC_SUCCESS
;
}
...
...
@@ -423,14 +426,14 @@ int playlist_AddInput( playlist_t* p_playlist, input_item_t *p_input,
PL_LOCK_IF
(
!
b_locked
);
/* Add to ONELEVEL */
p_item_one
=
playlist_ItemNewFromInput
(
p_playlist
,
p_input
);
p_item_one
=
playlist_ItemNewFromInput
(
p_playlist
,
p_input
,
false
);
if
(
p_item_one
==
NULL
)
return
VLC_ENOMEM
;
AddItem
(
p_playlist
,
p_item_one
,
b_playlist
?
p_playlist
->
p_local_onelevel
:
p_playlist
->
p_ml_onelevel
,
i_mode
,
i_pos
);
/* Add to CATEGORY */
p_item_cat
=
playlist_ItemNewFromInput
(
p_playlist
,
p_input
);
p_item_cat
=
playlist_ItemNewFromInput
(
p_playlist
,
p_input
,
true
);
if
(
p_item_cat
==
NULL
)
return
VLC_ENOMEM
;
AddItem
(
p_playlist
,
p_item_cat
,
b_playlist
?
p_playlist
->
p_local_category
:
...
...
@@ -475,13 +478,13 @@ int playlist_BothAddInput( playlist_t *p_playlist,
PL_LOCK_IF
(
!
b_locked
);
/* Add to category */
p_item_cat
=
playlist_ItemNewFromInput
(
p_playlist
,
p_input
);
p_item_cat
=
playlist_ItemNewFromInput
(
p_playlist
,
p_input
,
true
);
if
(
p_item_cat
==
NULL
)
return
VLC_ENOMEM
;
AddItem
(
p_playlist
,
p_item_cat
,
p_direct_parent
,
i_mode
,
i_pos
);
/* Add to onelevel */
/** \todo make a faster case for ml import */
p_item_one
=
playlist_ItemNewFromInput
(
p_playlist
,
p_input
);
p_item_one
=
playlist_ItemNewFromInput
(
p_playlist
,
p_input
,
false
);
if
(
p_item_one
==
NULL
)
return
VLC_ENOMEM
;
p_up
=
p_direct_parent
;
...
...
@@ -536,7 +539,7 @@ playlist_item_t * playlist_NodeAddInput( playlist_t *p_playlist,
return
NULL
;
PL_LOCK_IF
(
!
b_locked
);
p_item
=
playlist_ItemNewFromInput
(
p_playlist
,
p_input
);
p_item
=
playlist_ItemNewFromInput
(
p_playlist
,
p_input
,
true
);
if
(
p_item
==
NULL
)
return
NULL
;
AddItem
(
p_playlist
,
p_item
,
p_parent
,
i_mode
,
i_pos
);
...
...
src/playlist/playlist_internal.h
View file @
22b2b54f
...
...
@@ -109,7 +109,8 @@ void pl_Deactivate (libvlc_int_t *);
/* */
playlist_item_t
*
playlist_ItemNewFromInput
(
playlist_t
*
p_playlist
,
input_item_t
*
p_input
);
input_item_t
*
p_input
,
bool
install_observer
);
/* Engine */
playlist_item_t
*
get_current_status_item
(
playlist_t
*
p_playlist
);
...
...
src/playlist/tree.c
View file @
22b2b54f
...
...
@@ -69,7 +69,7 @@ playlist_item_t * playlist_NodeCreate( playlist_t *p_playlist,
p_new_input
=
input_item_NewWithType
(
VLC_OBJECT
(
p_playlist
),
NULL
,
psz_name
,
0
,
NULL
,
0
,
-
1
,
ITEM_TYPE_NODE
);
p_item
=
playlist_ItemNewFromInput
(
p_playlist
,
p_input
?
p_input
:
p_new_input
);
p_input
?
p_input
:
p_new_input
,
p_input
==
NULL
);
if
(
p_new_input
)
vlc_gc_decref
(
p_new_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