Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
e8c856b9
Commit
e8c856b9
authored
Mar 09, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
metaengine: folder: test uri against folder first. (fix #10380)
because make_path strips last segment
parent
177078ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
13 deletions
+42
-13
modules/meta_engine/folder.c
modules/meta_engine/folder.c
+42
-13
No files found.
modules/meta_engine/folder.c
View file @
e8c856b9
...
...
@@ -75,24 +75,54 @@ static int FindMeta( vlc_object_t *p_this )
art_finder_t
*
p_finder
=
(
art_finder_t
*
)
p_this
;
input_item_t
*
p_item
=
p_finder
->
p_item
;
bool
b_have_art
=
false
;
struct
stat
statinfo
;
char
*
psz_path
=
NULL
;
if
(
!
p_item
)
return
VLC_EGENERIC
;
char
*
psz_
dir
=
input_item_GetURI
(
p_item
);
if
(
!
psz_
dir
)
char
*
psz_
uri
=
input_item_GetURI
(
p_item
);
if
(
!
psz_
uri
)
return
VLC_EGENERIC
;
char
*
psz_path
=
make_path
(
psz_dir
);
free
(
psz_dir
);
if
(
psz_path
==
NULL
)
return
VLC_EGENERIC
;
if
(
*
psz_uri
&&
psz_uri
[
strlen
(
psz_uri
)
-
1
]
!=
DIR_SEP_CHAR
)
{
if
(
asprintf
(
&
psz_path
,
"%s"
DIR_SEP
,
psz_uri
)
==
-
1
)
{
free
(
psz_uri
);
return
VLC_EGENERIC
;
}
char
*
psz_basedir
=
make_path
(
psz_path
);
FREENULL
(
psz_path
);
if
(
psz_basedir
==
NULL
)
{
free
(
psz_uri
);
return
VLC_EGENERIC
;
}
if
(
vlc_stat
(
psz_basedir
,
&
statinfo
)
==
0
&&
S_ISDIR
(
statinfo
.
st_mode
)
)
psz_path
=
psz_basedir
;
else
free
(
psz_basedir
);
}
if
(
psz_path
==
NULL
)
{
char
*
psz_basedir
=
make_path
(
psz_uri
);
if
(
psz_basedir
==
NULL
)
{
free
(
psz_uri
);
return
VLC_EGENERIC
;
}
char
*
psz_buf
=
strrchr
(
psz_basedir
,
DIR_SEP_CHAR
);
if
(
psz_buf
)
*++
psz_buf
=
'\0'
;
else
*
psz_basedir
=
'\0'
;
/* relative path */
psz_path
=
psz_basedir
;
}
char
*
psz_buf
=
strrchr
(
psz_path
,
DIR_SEP_CHAR
);
if
(
psz_buf
)
*++
psz_buf
=
'\0'
;
else
*
psz_path
=
'\0'
;
/* relative path */
free
(
psz_uri
);
for
(
int
i
=
-
1
;
!
b_have_art
&&
i
<
i_covers
;
i
++
)
{
...
...
@@ -118,8 +148,7 @@ static int FindMeta( vlc_object_t *p_this )
if
(
unlikely
(
filepath
==
NULL
)
)
continue
;
struct
stat
dummy
;
if
(
vlc_stat
(
filepath
,
&
dummy
)
==
0
)
if
(
vlc_stat
(
filepath
,
&
statinfo
)
==
0
&&
S_ISREG
(
statinfo
.
st_mode
)
)
{
char
*
psz_uri
=
vlc_path2uri
(
filepath
,
"file"
);
if
(
psz_uri
)
...
...
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