Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
71ec2c47
Commit
71ec2c47
authored
Nov 16, 2016
by
Pierre Ynard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
luasd: de-duplicate script names before probing
Fix #3353
parent
6290ebf6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
9 deletions
+24
-9
modules/lua/vlc.c
modules/lua/vlc.c
+24
-9
No files found.
modules/lua/vlc.c
View file @
71ec2c47
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
#include "vlc.h"
#include "vlc.h"
#include <vlc_plugin.h>
#include <vlc_plugin.h>
#include <vlc_arrays.h>
#include <vlc_charset.h>
#include <vlc_charset.h>
#include <vlc_fs.h>
#include <vlc_fs.h>
#include <vlc_services_discovery.h>
#include <vlc_services_discovery.h>
...
@@ -619,7 +620,9 @@ int vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
...
@@ -619,7 +620,9 @@ int vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
static
int
vlc_sd_probe_Open
(
vlc_object_t
*
obj
)
static
int
vlc_sd_probe_Open
(
vlc_object_t
*
obj
)
{
{
int
r
=
VLC_PROBE_CONTINUE
;
vlc_dictionary_t
name_d
;
vlc_dictionary_init
(
&
name_d
,
32
);
char
**
ppsz_dir_list
;
char
**
ppsz_dir_list
;
vlclua_dir_list
(
"sd"
,
&
ppsz_dir_list
);
vlclua_dir_list
(
"sd"
,
&
ppsz_dir_list
);
for
(
char
**
ppsz_dir
=
ppsz_dir_list
;
*
ppsz_dir
;
ppsz_dir
++
)
for
(
char
**
ppsz_dir
=
ppsz_dir_list
;
*
ppsz_dir
;
ppsz_dir
++
)
...
@@ -635,18 +638,30 @@ static int vlc_sd_probe_Open( vlc_object_t *obj )
...
@@ -635,18 +638,30 @@ static int vlc_sd_probe_Open( vlc_object_t *obj )
char
*
temp
=
strchr
(
*
ppsz_file
,
'.'
);
char
*
temp
=
strchr
(
*
ppsz_file
,
'.'
);
if
(
temp
)
if
(
temp
)
*
temp
=
'\0'
;
*
temp
=
'\0'
;
r
=
vlclua_probe_sd
(
obj
,
*
ppsz_file
);
if
(
r
!=
VLC_PROBE_CONTINUE
)
if
(
vlc_dictionary_value_for_key
(
&
name_d
,
*
ppsz_file
)
==
break
;
kVLCDictionaryNotFound
)
}
vlc_dictionary_insert
(
&
name_d
,
*
ppsz_file
,
&
name_d
);
for
(
char
**
ppsz_file
=
ppsz_filelist
;
ppsz_file
<
ppsz_filelist
+
i_files
;
ppsz_file
++
)
free
(
*
ppsz_file
);
free
(
*
ppsz_file
);
}
free
(
ppsz_filelist
);
free
(
ppsz_filelist
);
}
vlclua_dir_list_free
(
ppsz_dir_list
);
int
r
=
VLC_PROBE_CONTINUE
;
char
**
names
=
vlc_dictionary_all_keys
(
&
name_d
);
if
(
names
!=
NULL
)
{
for
(
char
**
name
=
names
;
*
name
!=
NULL
;
name
++
)
{
r
=
vlclua_probe_sd
(
obj
,
*
name
);
if
(
r
!=
VLC_PROBE_CONTINUE
)
if
(
r
!=
VLC_PROBE_CONTINUE
)
break
;
break
;
}
}
vlclua_dir_list_free
(
ppsz_dir_list
);
free
(
names
);
}
vlc_dictionary_clear
(
&
name_d
,
NULL
,
NULL
);
return
r
;
return
r
;
}
}
...
...
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