Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
8072808a
Commit
8072808a
authored
Dec 11, 2004
by
Sigmund Augdal Helberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
directory.c: sort items before adding to playlist
parent
2a5e51a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
18 deletions
+13
-18
modules/access/directory.c
modules/access/directory.c
+13
-18
No files found.
modules/access/directory.c
View file @
8072808a
...
...
@@ -338,6 +338,10 @@ static int DemuxControl( demux_t *p_demux, int i_query, va_list args )
i_query
,
args
);
}
static
int
Filter
(
struct
direct
*
foo
)
{
return
VLC_TRUE
;
}
/*****************************************************************************
* ReadDir: read a directory and add its content to the list
*****************************************************************************/
...
...
@@ -347,33 +351,23 @@ static int ReadDir( playlist_t *p_playlist,
{
DIR
*
p_current_dir
;
struct
dirent
*
p_dir_content
;
struct
dirent
**
pp_dir_content
;
int
i_dir_content
;
playlist_item_t
*
p_node
;
int
i
=
0
;
/* Change the item to a node */
if
(
p_parent
->
i_children
==
-
1
)
{
playlist_ItemToNode
(
p_playlist
,
p_parent
);
}
/* Open the dir */
p_current_dir
=
opendir
(
psz_name
);
if
(
p_current_dir
==
NULL
)
{
/* something went bad, get out of here ! */
# ifdef HAVE_ERRNO_H
msg_Warn
(
p_playlist
,
"cannot open directory `%s' (%s)"
,
psz_name
,
strerror
(
errno
));
# else
msg_Warn
(
p_playlist
,
"cannot open directory `%s'"
,
psz_name
);
# endif
return
VLC_EGENERIC
;
}
/* get the first directory entry */
p_dir_content
=
readdir
(
p_current_dir
);
i_dir_content
=
scandir
(
psz_name
,
&
pp_dir_content
,
Filter
,
alphasort
);
p_dir_content
=
pp_dir_content
[
0
];
/* while we still have entries in the directory */
while
(
p_dir_content
!=
NULL
)
while
(
i
<
i_dir_content
)
{
int
i_size_entry
=
strlen
(
psz_name
)
+
strlen
(
p_dir_content
->
d_name
)
+
2
;
...
...
@@ -446,9 +440,10 @@ static int ReadDir( playlist_t *p_playlist,
}
}
free
(
psz_uri
);
p_dir_content
=
readdir
(
p_current_dir
);
i
++
;
p_dir_content
=
pp_dir_content
[
i
];
}
closedir
(
p_current_dir
);
free
(
pp_dir_content
);
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