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
04fb7e89
Commit
04fb7e89
authored
Nov 29, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Namespace/rename make_path to vlc_uri2path
parent
7b331c54
Changes
23
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
55 additions
and
41 deletions
+55
-41
include/vlc_url.h
include/vlc_url.h
+29
-2
modules/gui/ncurses.c
modules/gui/ncurses.c
+1
-1
modules/gui/qt4/components/info_panels.cpp
modules/gui/qt4/components/info_panels.cpp
+1
-1
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
+1
-1
modules/gui/qt4/dialogs/mediainfo.cpp
modules/gui/qt4/dialogs/mediainfo.cpp
+1
-1
modules/gui/qt4/dialogs_provider.cpp
modules/gui/qt4/dialogs_provider.cpp
+1
-1
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.cpp
+1
-1
modules/gui/qt4/recents.cpp
modules/gui/qt4/recents.cpp
+1
-1
modules/gui/skins2/src/top_window.cpp
modules/gui/skins2/src/top_window.cpp
+1
-1
modules/gui/skins2/src/vlcproc.cpp
modules/gui/skins2/src/vlcproc.cpp
+1
-1
modules/lua/libs/strings.c
modules/lua/libs/strings.c
+1
-1
modules/meta_engine/folder.c
modules/meta_engine/folder.c
+2
-2
modules/meta_engine/taglib.cpp
modules/meta_engine/taglib.cpp
+3
-3
modules/misc/playlist/m3u.c
modules/misc/playlist/m3u.c
+1
-1
modules/notify/notify.c
modules/notify/notify.c
+1
-1
modules/notify/osx_notifications.m
modules/notify/osx_notifications.m
+1
-1
modules/stream_out/rtp.c
modules/stream_out/rtp.c
+1
-1
src/input/access.c
src/input/access.c
+2
-2
src/input/meta.c
src/input/meta.c
+1
-1
src/input/subtitles.c
src/input/subtitles.c
+1
-1
src/libvlccore.sym
src/libvlccore.sym
+1
-1
src/test/url.c
src/test/url.c
+1
-1
src/text/url.c
src/text/url.c
+1
-14
No files found.
include/vlc_url.h
View file @
04fb7e89
...
...
@@ -28,9 +28,34 @@
/**
* \file
* This file defines functions for manipulating URL in vlc
*
* \ingroup strings
* @{
*/
/**
* Converts local path to URL.
*
* Builds a URL representation from a local UTF-8 null-terminated file path.
*
* @param path file path
* @param scheme URI scheme to use (default is auto: "file", "fd" or "smb")
* @return a heap-allocated URI string on success
* or NULL in case of error (errno will be set accordingly)
*/
VLC_API
char
*
vlc_path2uri
(
const
char
*
path
,
const
char
*
scheme
)
VLC_MALLOC
;
VLC_API
char
*
vlc_path2uri
(
const
char
*
path
,
const
char
*
scheme
)
VLC_MALLOC
;
/**
* Converts a URI to a local path.
*
* Builds a local path (UTF-8-encoded null-terminated string) from a URI if
* the URI scheme allows.
*
* @param url URI
* @return a heap-allocated string or success
* or NULL on error
*/
VLC_API
char
*
vlc_uri2path
(
const
char
*
url
)
VLC_MALLOC
;
struct
vlc_url_t
{
...
...
@@ -48,8 +73,10 @@ struct vlc_url_t
VLC_API
char
*
decode_URI_duplicate
(
const
char
*
psz
)
VLC_MALLOC
;
VLC_API
char
*
decode_URI
(
char
*
psz
);
VLC_API
char
*
encode_URI_component
(
const
char
*
psz
)
VLC_MALLOC
;
VLC_API
char
*
make_path
(
const
char
*
url
)
VLC_MALLOC
;
/** @} */
VLC_API
void
vlc_UrlParse
(
vlc_url_t
*
,
const
char
*
);
VLC_API
void
vlc_UrlClean
(
vlc_url_t
*
);
#endif
modules/gui/ncurses.c
View file @
04fb7e89
...
...
@@ -1070,7 +1070,7 @@ static int DrawStatus(intf_thread_t *intf, input_thread_t *p_input)
char
*
path
,
*
uri
;
uri
=
input_item_GetURI
(
input_GetItem
(
p_input
));
path
=
make_
path
(
uri
);
path
=
vlc_uri2
path
(
uri
);
mvnprintw
(
y
++
,
0
,
COLS
,
_
(
" Source : %s"
),
path
?
path
:
uri
);
free
(
uri
);
...
...
modules/gui/qt4/components/info_panels.cpp
View file @
04fb7e89
...
...
@@ -281,7 +281,7 @@ void MetaPanel::update( input_item_t *p_item )
char
*
psz_art
=
input_item_GetArtURL
(
p_item
);
if
(
psz_art
)
{
char
*
psz
=
make_
path
(
psz_art
);
char
*
psz
=
vlc_uri2
path
(
psz_art
);
free
(
psz_art
);
file
=
qfu
(
psz
);
free
(
psz
);
...
...
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
04fb7e89
...
...
@@ -313,7 +313,7 @@ void StandardPLPanel::popupAction( QAction *action )
case
VLCModelSubInterface
:
:
ACTION_EXPLORE
:
/* locally handled only */
temp
=
model
->
getURI
(
index
);
if
(
!
temp
.
isEmpty
()
)
path
=
make_
path
(
temp
.
toLatin1
().
constData
()
);
if
(
!
temp
.
isEmpty
()
)
path
=
vlc_uri2
path
(
temp
.
toLatin1
().
constData
()
);
if
(
path
==
NULL
)
return
;
QDesktopServices
::
openUrl
(
QUrl
::
fromLocalFile
(
QFileInfo
(
qfu
(
path
)
).
absolutePath
()
)
);
...
...
modules/gui/qt4/dialogs/mediainfo.cpp
View file @
04fb7e89
...
...
@@ -195,7 +195,7 @@ void MediaInfoDialog::updateURI( const QString& uri )
QString
location
;
/* If URI points to a local file, show the path instead of the URI */
char
*
path
=
make_
path
(
qtu
(
uri
)
);
char
*
path
=
vlc_uri2
path
(
qtu
(
uri
)
);
if
(
path
!=
NULL
)
{
location
=
qfu
(
path
);
...
...
modules/gui/qt4/dialogs_provider.cpp
View file @
04fb7e89
...
...
@@ -781,7 +781,7 @@ void DialogsProvider::loadSubtitlesFile()
char
*
path2
=
NULL
;
if
(
path
)
{
path2
=
make_
path
(
path
);
path2
=
vlc_uri2
path
(
path
);
free
(
path
);
if
(
path2
)
{
...
...
modules/gui/qt4/input_manager.cpp
View file @
04fb7e89
...
...
@@ -718,7 +718,7 @@ const QString InputManager::decodeArtURL( input_item_t *p_item )
char
*
psz_art
=
input_item_GetArtURL
(
p_item
);
if
(
psz_art
)
{
char
*
psz
=
make_
path
(
psz_art
);
char
*
psz
=
vlc_uri2
path
(
psz_art
);
free
(
psz_art
);
psz_art
=
psz
;
}
...
...
modules/gui/qt4/recents.cpp
View file @
04fb7e89
...
...
@@ -88,7 +88,7 @@ void RecentsMRL::addRecent( const QString &mrl )
#ifdef _WIN32
/* Add to the Windows 7 default list in taskbar */
char
*
path
=
make_
path
(
qtu
(
mrl
)
);
char
*
path
=
vlc_uri2
path
(
qtu
(
mrl
)
);
if
(
path
)
{
wchar_t
*
wmrl
=
ToWide
(
path
);
...
...
modules/gui/skins2/src/top_window.cpp
View file @
04fb7e89
...
...
@@ -264,7 +264,7 @@ void TopWindow::processEvent( EvtDragDrop &rEvtDragDrop )
if
(
files
.
size
()
==
1
&&
pInput
!=
NULL
)
{
std
::
list
<
std
::
string
>::
const_iterator
it
=
files
.
begin
();
char
*
psz_file
=
make_
path
(
it
->
c_str
()
);
char
*
psz_file
=
vlc_uri2
path
(
it
->
c_str
()
);
if
(
psz_file
)
{
is_subtitle
=
!
input_AddSubtitleOSD
(
pInput
,
psz_file
,
true
,
true
);
...
...
modules/gui/skins2/src/vlcproc.cpp
View file @
04fb7e89
...
...
@@ -754,7 +754,7 @@ void VlcProc::update_current_input()
// Update local path (if possible) or full uri
char
*
psz_uri
=
input_item_GetURI
(
pItem
);
char
*
psz_path
=
make_
path
(
psz_uri
);
char
*
psz_path
=
vlc_uri2
path
(
psz_uri
);
char
*
psz_save
=
psz_path
?
psz_path
:
psz_uri
;
SET_TEXT
(
m_cVarStreamURI
,
UString
(
getIntf
(),
psz_save
)
);
free
(
psz_path
);
...
...
modules/lua/libs/strings.c
View file @
04fb7e89
...
...
@@ -95,7 +95,7 @@ static int vlclua_make_uri( lua_State *L )
static
int
vlclua_make_path
(
lua_State
*
L
)
{
const
char
*
psz_input
=
luaL_checkstring
(
L
,
1
);
char
*
psz_path
=
make_
path
(
psz_input
);
char
*
psz_path
=
vlc_uri2
path
(
psz_input
);
lua_pushstring
(
L
,
psz_path
);
free
(
psz_path
);
return
1
;
...
...
modules/meta_engine/folder.c
View file @
04fb7e89
...
...
@@ -92,7 +92,7 @@ static int FindMeta( vlc_object_t *p_this )
free
(
psz_uri
);
return
VLC_EGENERIC
;
}
char
*
psz_basedir
=
make_
path
(
psz_path
);
char
*
psz_basedir
=
vlc_uri2
path
(
psz_path
);
FREENULL
(
psz_path
);
if
(
psz_basedir
==
NULL
)
{
...
...
@@ -107,7 +107,7 @@ static int FindMeta( vlc_object_t *p_this )
if
(
psz_path
==
NULL
)
{
char
*
psz_basedir
=
make_
path
(
psz_uri
);
char
*
psz_basedir
=
vlc_uri2
path
(
psz_uri
);
if
(
psz_basedir
==
NULL
)
{
free
(
psz_uri
);
...
...
modules/meta_engine/taglib.cpp
View file @
04fb7e89
...
...
@@ -32,7 +32,7 @@
#include <vlc_demux.h>
/* demux_meta_t */
#include <vlc_strings.h>
/* vlc_b64_decode_binary */
#include <vlc_input.h>
/* for attachment_new */
#include <vlc_url.h>
/*
make_
path */
#include <vlc_url.h>
/*
vlc_uri2
path */
#include <vlc_mime.h>
/* mime type */
#include <vlc_fs.h>
...
...
@@ -689,7 +689,7 @@ static int ReadMeta( vlc_object_t* p_this)
if
(
unlikely
(
psz_uri
==
NULL
)
)
return
VLC_ENOMEM
;
char
*
psz_path
=
make_
path
(
psz_uri
);
char
*
psz_path
=
vlc_uri2
path
(
psz_uri
);
free
(
psz_uri
);
if
(
psz_path
==
NULL
)
return
VLC_EGENERIC
;
...
...
@@ -916,7 +916,7 @@ static void WriteMetaToId3v2( ID3v2::Tag* tag, input_item_t* p_item )
if
(
psz_url
==
NULL
)
return
;
char
*
psz_path
=
make_
path
(
psz_url
);
char
*
psz_path
=
vlc_uri2
path
(
psz_url
);
free
(
psz_url
);
if
(
psz_path
==
NULL
)
return
;
...
...
modules/misc/playlist/m3u.c
View file @
04fb7e89
...
...
@@ -108,7 +108,7 @@ static void DoChildren( playlist_export_t *p_export, playlist_item_t *p_root,
vlc_mutex_unlock
(
&
p_current
->
p_input
->
lock
);
/* Stupid third party players don't understand file: URIs. */
char
*
psz_path
=
make_
path
(
psz_uri
);
char
*
psz_path
=
vlc_uri2
path
(
psz_uri
);
if
(
psz_path
!=
NULL
)
{
free
(
psz_uri
);
...
...
modules/notify/notify.c
View file @
04fb7e89
...
...
@@ -205,7 +205,7 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
if
(
psz_arturl
)
{
char
*
psz
=
make_
path
(
psz_arturl
);
char
*
psz
=
vlc_uri2
path
(
psz_arturl
);
free
(
psz_arturl
);
psz_arturl
=
psz
;
}
...
...
modules/notify/osx_notifications.m
View file @
04fb7e89
...
...
@@ -257,7 +257,7 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
char
*
psz_arturl
=
input_item_GetArtURL
(
p_item
);
if
(
psz_arturl
)
{
char
*
psz
=
make_
path
(
psz_arturl
);
char
*
psz
=
vlc_uri2
path
(
psz_arturl
);
free
(
psz_arturl
);
psz_arturl
=
psz
;
}
...
...
modules/stream_out/rtp.c
View file @
04fb7e89
...
...
@@ -758,7 +758,7 @@ static void SDPHandleUrl( sout_stream_t *p_stream, const char *psz_url )
msg_Err
(
p_stream
,
"you can use sdp=file:// only once"
);
goto
out
;
}
p_sys
->
psz_sdp_file
=
make_
path
(
psz_url
);
p_sys
->
psz_sdp_file
=
vlc_uri2
path
(
psz_url
);
if
(
p_sys
->
psz_sdp_file
==
NULL
)
goto
out
;
FileSetup
(
p_stream
);
...
...
src/input/access.c
View file @
04fb7e89
...
...
@@ -44,12 +44,12 @@ char *get_path(const char *location)
char
*
url
,
*
path
;
/* Prepending "file://" is a bit hackish. But then again, we do not want
* to hard-code the list of schemes that use file paths in
make_
path().
* to hard-code the list of schemes that use file paths in
vlc_uri2
path().
*/
if
(
asprintf
(
&
url
,
"file://%s"
,
location
)
==
-
1
)
return
NULL
;
path
=
make_
path
(
url
);
path
=
vlc_uri2
path
(
url
);
free
(
url
);
return
path
;
}
...
...
src/input/meta.c
View file @
04fb7e89
...
...
@@ -273,7 +273,7 @@ int input_item_WriteMeta( vlc_object_t *obj, input_item_t *p_item )
goto
error
;
char
*
psz_uri
=
input_item_GetURI
(
p_item
);
p_export
->
psz_file
=
make_
path
(
psz_uri
);
p_export
->
psz_file
=
vlc_uri2
path
(
psz_uri
);
if
(
p_export
->
psz_file
==
NULL
)
msg_Err
(
p_export
,
"cannot write meta to remote media %s"
,
psz_uri
);
free
(
psz_uri
);
...
...
src/input/subtitles.c
View file @
04fb7e89
...
...
@@ -259,7 +259,7 @@ char **subtitles_Detect( input_thread_t *p_this, char *psz_path,
if
(
!
psz_name_org
)
return
NULL
;
char
*
psz_fname
=
make_
path
(
psz_name_org
);
char
*
psz_fname
=
vlc_uri2
path
(
psz_name_org
);
if
(
!
psz_fname
)
return
NULL
;
...
...
src/libvlccore.sym
View file @
04fb7e89
...
...
@@ -245,7 +245,7 @@ libvlc_ArtRequest
vlc_UrlParse
vlc_UrlClean
vlc_path2uri
make_
path
vlc_uri2
path
mdate
module_config_free
module_config_get
...
...
src/test/url.c
View file @
04fb7e89
...
...
@@ -169,7 +169,7 @@ int main (void)
assert (val != -1);*/
/* URI to path tests */
#define test( a, b ) test (
make_
path, a, b)
#define test( a, b ) test (
vlc_uri2
path, a, b)
test
(
"mailto:john@example.com"
,
NULL
);
test
(
"http://www.example.com/file.html#ref"
,
NULL
);
test
(
"file://"
,
NULL
);
...
...
src/text/url.c
View file @
04fb7e89
...
...
@@ -143,13 +143,6 @@ char *encode_URI_component (const char *str)
return
ret
;
}
/**
* Builds a URL representation from a local file path.
* @param path path to convert (or URI to copy)
* @param scheme URI scheme to use (default is auto: "file", "fd" or "smb")
* @return a nul-terminated URI string (use free() to release it),
* or NULL in case of error (errno will be set accordingly)
*/
char
*
vlc_path2uri
(
const
char
*
path
,
const
char
*
scheme
)
{
if
(
path
==
NULL
)
...
...
@@ -252,13 +245,7 @@ char *vlc_path2uri (const char *path, const char *scheme)
return
buf
;
}
/**
* Tries to convert a URI to a local (UTF-8-encoded) file path.
* @param url URI to convert
* @return NULL on error, a nul-terminated string otherwise
* (use free() to release it)
*/
char
*
make_path
(
const
char
*
url
)
char
*
vlc_uri2path
(
const
char
*
url
)
{
char
*
ret
=
NULL
;
char
*
end
;
...
...
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