Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
e4b58df6
Commit
e4b58df6
authored
May 18, 2015
by
Thomas Guillem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist: don't play directories that can loop into themselves
parent
8990da12
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
1 deletion
+23
-1
include/vlc_input_item.h
include/vlc_input_item.h
+1
-0
modules/demux/playlist/directory.c
modules/demux/playlist/directory.c
+5
-1
src/input/item.c
src/input/item.c
+1
-0
src/playlist/item.c
src/playlist/item.c
+16
-0
No files found.
include/vlc_input_item.h
View file @
e4b58df6
...
...
@@ -122,6 +122,7 @@ struct input_item_node_t
input_item_node_t
**
pp_children
;
input_item_node_t
*
p_parent
;
input_item_compar_cb
compar_cb
;
bool
b_can_loop
;
};
VLC_API
void
input_item_CopyOptions
(
input_item_t
*
p_parent
,
input_item_t
*
p_child
);
...
...
modules/demux/playlist/directory.c
View file @
e4b58df6
...
...
@@ -36,6 +36,7 @@
struct
demux_sys_t
{
bool
b_dir_sorted
;
bool
b_dir_can_loop
;
};
/*****************************************************************************
...
...
@@ -50,14 +51,16 @@ int Import_Dir ( vlc_object_t *p_this)
bool
b_is_dir
=
false
;
bool
b_dir_sorted
=
false
;
bool
b_dir_can_loop
=
false
;
int
i_err
=
stream_Control
(
p_demux
->
s
,
STREAM_IS_DIRECTORY
,
&
b_is_dir
,
&
b_dir_sorted
,
NULL
);
&
b_dir_sorted
,
&
b_dir_can_loop
);
if
(
!
(
i_err
==
VLC_SUCCESS
&&
b_is_dir
)
)
return
VLC_EGENERIC
;
STANDARD_DEMUX_INIT_MSG
(
"reading directory content"
);
p_demux
->
p_sys
->
b_dir_sorted
=
b_dir_sorted
;
p_demux
->
p_sys
->
b_dir_can_loop
=
b_dir_can_loop
;
return
VLC_SUCCESS
;
}
...
...
@@ -153,6 +156,7 @@ static int Demux( demux_t *p_demux )
p_input
=
GetCurrentItem
(
p_demux
);
p_node
=
input_item_node_Create
(
p_input
);
p_node
->
b_can_loop
=
p_demux
->
p_sys
->
b_dir_can_loop
;
input_item_Release
(
p_input
);
b_show_hiddenfiles
=
var_InheritBool
(
p_demux
,
"show-hiddenfiles"
);
...
...
src/input/item.c
View file @
e4b58df6
...
...
@@ -1102,6 +1102,7 @@ input_item_node_t *input_item_node_Create( input_item_t *p_input )
p_node
->
p_parent
=
NULL
;
p_node
->
i_children
=
0
;
p_node
->
pp_children
=
NULL
;
p_node
->
b_can_loop
=
false
;
return
p_node
;
}
...
...
src/playlist/item.c
View file @
e4b58df6
...
...
@@ -150,6 +150,22 @@ static void input_item_add_subitem_tree ( const vlc_event_t * p_event,
}
else
{
/* Don't Play a directory if it can loop into a parent */
if
(
p_new_root
->
b_can_loop
)
{
/* Play the first regular file */
for
(
;
pos
<
last_pos
;
pos
++
)
{
if
(
p_item
->
pp_children
[
pos
]
->
p_input
->
i_type
!=
ITEM_TYPE_DIRECTORY
)
break
;
}
if
(
last_pos
==
pos
)
{
PL_UNLOCK
;
playlist_Stop
(
p_playlist
);
return
;
}
}
p_play_item
=
p_item
->
pp_children
[
pos
];
/* NOTE: this is a work around the general bug:
if node-to-be-played contains sub-nodes, then second instead
...
...
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