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
dd22f44c
Commit
dd22f44c
authored
Feb 13, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
addons: fix path vs uri usage
fixes Win32 installs
parent
6b19dc64
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
15 deletions
+29
-15
modules/misc/addons/fsstorage.c
modules/misc/addons/fsstorage.c
+9
-4
modules/misc/addons/vorepository.c
modules/misc/addons/vorepository.c
+20
-11
No files found.
modules/misc/addons/fsstorage.c
View file @
dd22f44c
...
...
@@ -34,6 +34,7 @@
#include <vlc_fs.h>
#include <vlc_strings.h>
#include <vlc_xml.h>
#include <vlc_url.h>
#include "xmlreading.h"
#include <sys/stat.h>
...
...
@@ -652,7 +653,7 @@ static int LoadCatalog( addons_finder_t *p_finder )
char
*
psz_userdir
=
config_GetUserDir
(
VLC_DATA_DIR
);
if
(
!
psz_userdir
)
return
VLC_ENOMEM
;
if
(
asprintf
(
&
psz_path
,
"
file://
%s%s"
,
psz_userdir
,
ADDONS_CATALOG
)
<
1
)
if
(
asprintf
(
&
psz_path
,
"%s%s"
,
psz_userdir
,
ADDONS_CATALOG
)
<
1
)
{
free
(
psz_userdir
);
return
VLC_ENOMEM
;
...
...
@@ -671,16 +672,20 @@ static int LoadCatalog( addons_finder_t *p_finder )
char
*
psz_filename
=
NULL
;
int
i_filetype
=
-
1
;
const
char
*
psz_statpath
=
psz_path
+
7
;
// + scheme
struct
stat
stat_
;
if
(
vlc_stat
(
psz_
stat
path
,
&
stat_
)
)
if
(
vlc_stat
(
psz_path
,
&
stat_
)
)
{
free
(
psz_path
);
return
VLC_EGENERIC
;
}
stream_t
*
p_stream
=
stream_UrlNew
(
p_finder
,
psz_path
);
char
*
psz_catalog_uri
=
vlc_path2uri
(
psz_path
,
"file"
);
free
(
psz_path
);
if
(
!
psz_catalog_uri
)
return
VLC_EGENERIC
;
stream_t
*
p_stream
=
stream_UrlNew
(
p_finder
,
psz_catalog_uri
);
free
(
psz_catalog_uri
);
if
(
!
p_stream
)
return
VLC_EGENERIC
;
xml_reader_t
*
p_xml_reader
=
xml_ReaderCreate
(
p_finder
,
p_stream
);
...
...
modules/misc/addons/vorepository.c
View file @
dd22f44c
...
...
@@ -32,6 +32,7 @@
#include <vlc_addons.h>
#include <vlc_xml.h>
#include <vlc_fs.h>
#include <vlc_url.h>
#include "xmlreading.h"
#include "assert.h"
...
...
@@ -77,7 +78,7 @@ struct addons_finder_sys_t
};
static
int
ParseManifest
(
addons_finder_t
*
p_finder
,
addon_entry_t
*
p_entry
,
const
char
*
psz_tempfile
,
stream_t
*
p_stream
)
const
char
*
psz_tempfile
uri
,
stream_t
*
p_stream
)
{
int
i_num_entries_created
=
0
;
const
char
*
p_node
;
...
...
@@ -164,8 +165,8 @@ static int ParseManifest( addons_finder_t *p_finder, addon_entry_t *p_entry,
addon_file_t
*
p_file
=
malloc
(
sizeof
(
addon_file_t
)
);
p_file
->
e_filetype
=
i_filetype
;
p_file
->
psz_filename
=
strdup
(
psz_filename
);
if
(
asprintf
(
&
p_file
->
psz_download_uri
,
"
unzip://
%s!/%s"
,
psz_tempfile
,
psz_filename
)
>
0
)
if
(
asprintf
(
&
p_file
->
psz_download_uri
,
"%s!/%s"
,
psz_tempfile
uri
,
psz_filename
)
>
0
)
{
ARRAY_APPEND
(
p_entry
->
files
,
p_file
);
msg_Dbg
(
p_finder
,
"manifest lists file %s extractable from %s"
,
...
...
@@ -404,20 +405,28 @@ static int Retrieve( addons_finder_t *p_finder, addon_entry_t *p_entry )
msg_Dbg
(
p_finder
,
"Reading manifest from %s"
,
p_finder
->
p_sys
->
psz_tempfile
);
char
*
psz_manifest
;
if
(
asprintf
(
&
psz_manifest
,
"unzip://%s!/manifest.xml"
,
p_finder
->
p_sys
->
psz_tempfile
)
<
1
)
char
*
psz_tempfileuri
=
vlc_path2uri
(
p_finder
->
p_sys
->
psz_tempfile
,
"unzip"
);
if
(
!
psz_tempfileuri
)
return
VLC_ENOMEM
;
p_stream
=
stream_UrlNew
(
p_finder
,
psz_manifest
);
free
(
psz_manifest
);
char
*
psz_manifest_uri
;
if
(
asprintf
(
&
psz_manifest_uri
,
"%s!/manifest.xml"
,
psz_tempfileuri
)
<
1
)
{
free
(
psz_tempfileuri
);
return
VLC_ENOMEM
;
}
p_stream
=
stream_UrlNew
(
p_finder
,
psz_manifest_uri
);
free
(
psz_manifest_uri
);
if
(
!
p_stream
)
{
free
(
psz_tempfileuri
);
return
VLC_EGENERIC
;
}
int
i_ret
=
(
ParseManifest
(
p_finder
,
p_entry
,
p_finder
->
p_sys
->
psz_tempfile
,
p_stream
)
>
0
)
int
i_ret
=
(
ParseManifest
(
p_finder
,
p_entry
,
psz_tempfileuri
,
p_stream
)
>
0
)
?
VLC_SUCCESS
:
VLC_EGENERIC
;
free
(
psz_tempfileuri
);
stream_Delete
(
p_stream
);
return
i_ret
;
...
...
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