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
28e52ddb
Commit
28e52ddb
authored
Dec 20, 2009
by
Antoine Cellerier
Committed by
Antoine Cellerier
Dec 21, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add --data-path option. Access the src share directory now works from build tree.
parent
8241e584
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
99 additions
and
35 deletions
+99
-35
bin/vlc.c
bin/vlc.c
+1
-3
include/vlc_configuration.h
include/vlc_configuration.h
+2
-1
modules/control/http/http.c
modules/control/http/http.c
+2
-1
modules/gui/hildon/maemo.c
modules/gui/hildon/maemo.c
+3
-2
modules/gui/skins2/win32/win32_factory.cpp
modules/gui/skins2/win32/win32_factory.cpp
+6
-8
modules/gui/skins2/x11/x11_factory.cpp
modules/gui/skins2/x11/x11_factory.cpp
+3
-1
modules/misc/lua/intf.c
modules/misc/lua/intf.c
+3
-3
modules/misc/lua/libs/misc.c
modules/misc/lua/libs/misc.c
+5
-2
modules/misc/lua/libs/net.c
modules/misc/lua/libs/net.c
+1
-1
modules/misc/lua/vlc.c
modules/misc/lua/vlc.c
+7
-6
modules/misc/lua/vlc.h
modules/misc/lua/vlc.h
+1
-1
modules/misc/notify/growl.m
modules/misc/notify/growl.m
+2
-1
modules/misc/notify/notify.c
modules/misc/notify/notify.c
+3
-1
src/Makefile.am
src/Makefile.am
+1
-0
src/config/configuration.h
src/config/configuration.h
+2
-0
src/config/dirs.c
src/config/dirs.c
+46
-0
src/config/dirs_macos.c
src/config/dirs_macos.c
+1
-1
src/config/dirs_win.c
src/config/dirs_win.c
+1
-1
src/config/dirs_xdg.c
src/config/dirs_xdg.c
+1
-1
src/libvlc-module.c
src/libvlc-module.c
+7
-0
src/libvlccore.sym
src/libvlccore.sym
+1
-1
No files found.
bin/vlc.c
View file @
28e52ddb
...
...
@@ -133,9 +133,7 @@ int main( int i_argc, const char *ppsz_argv[] )
argv
[
argc
++
]
=
FromLocale
(
"--plugin-path="
TOP_BUILDDIR
"/modules"
);
#endif
#ifdef TOP_SRCDIR
# ifdef ENABLE_HTTPD
argv
[
argc
++
]
=
FromLocale
(
"--http-src="
TOP_SRCDIR
"/share/http"
);
# endif
argv
[
argc
++
]
=
FromLocale
(
"--data-path="
TOP_SRCDIR
"/share"
);
#endif
int
i
=
1
;
...
...
include/vlc_configuration.h
View file @
28e52ddb
...
...
@@ -214,7 +214,8 @@ VLC_EXPORT( int, __config_SaveConfigFile, ( vlc_object_t *, const char * ) );
VLC_EXPORT
(
void
,
__config_ResetAll
,
(
vlc_object_t
*
)
);
VLC_EXPORT
(
module_config_t
*
,
config_FindConfig
,(
vlc_object_t
*
,
const
char
*
)
LIBVLC_USED
);
VLC_EXPORT
(
const
char
*
,
config_GetDataDir
,
(
void
)
LIBVLC_USED
);
VLC_EXPORT
(
char
*
,
__config_GetDataDir
,
(
vlc_object_t
*
)
LIBVLC_USED
);
#define config_GetDataDir(a) __config_GetDataDir(VLC_OBJECT(a))
VLC_EXPORT
(
const
char
*
,
config_GetConfDir
,
(
void
)
LIBVLC_USED
);
typedef
enum
vlc_userdir
...
...
modules/control/http/http.c
View file @
28e52ddb
...
...
@@ -232,9 +232,10 @@ static int Open( vlc_object_t *p_this )
psz_src
=
config_GetPsz
(
p_intf
,
"http-src"
);
if
(
(
psz_src
==
NULL
)
||
(
*
psz_src
==
'\0'
)
)
{
c
onst
char
*
data_path
=
config_GetDataDir
(
);
c
har
*
data_path
=
config_GetDataDir
(
p_intf
);
if
(
asprintf
(
&
psz_src
,
"%s"
DIR_SEP
"http"
,
data_path
)
==
-
1
)
psz_src
=
NULL
;
free
(
data_path
);
}
if
(
!
psz_src
||
*
psz_src
==
'\0'
)
...
...
modules/gui/hildon/maemo.c
View file @
28e52ddb
...
...
@@ -158,12 +158,13 @@ static void Run( intf_thread_t *p_intf )
// A little theming
char
*
psz_rc_file
=
NULL
;
if
(
asprintf
(
&
psz_rc_file
,
"%s/maemo/vlc_intf.rc"
,
config_GetDataDir
()
)
!=
-
1
)
char
*
psz_data
=
config_GetDataDir
(
p_intf
);
if
(
asprintf
(
&
psz_rc_file
,
"%s/maemo/vlc_intf.rc"
,
psz_data
)
!=
-
1
)
{
gtk_rc_parse
(
psz_rc_file
);
free
(
psz_rc_file
);
}
free
(
psz_data
);
// We create the main vertical box
main_vbox
=
gtk_vbox_new
(
FALSE
,
0
);
...
...
modules/gui/skins2/win32/win32_factory.cpp
View file @
28e52ddb
...
...
@@ -229,14 +229,12 @@ bool Win32Factory::init()
char
*
datadir
=
config_GetUserDir
(
VLC_DATA_DIR
);
m_resourcePath
.
push_back
(
(
string
)
datadir
+
"
\\
skins"
);
free
(
datadir
);
m_resourcePath
.
push_back
(
(
string
)
config_GetDataDir
()
+
"
\\
skins"
);
m_resourcePath
.
push_back
(
(
string
)
config_GetDataDir
()
+
"
\\
skins2"
);
m_resourcePath
.
push_back
(
(
string
)
config_GetDataDir
()
+
"
\\
share
\\
skins"
);
m_resourcePath
.
push_back
(
(
string
)
config_GetDataDir
()
+
"
\\
share
\\
skins2"
);
datadir
=
config_GetDataDir
(
getIntf
()
);
m_resourcePath
.
push_back
(
(
string
)
datadir
+
"
\\
skins"
);
m_resourcePath
.
push_back
(
(
string
)
datadir
+
"
\\
skins2"
);
m_resourcePath
.
push_back
(
(
string
)
datadir
+
"
\\
share
\\
skins"
);
m_resourcePath
.
push_back
(
(
string
)
datadir
+
"
\\
share
\\
skins2"
);
free
(
datadir
);
// All went well
return
true
;
...
...
modules/gui/skins2/x11/x11_factory.cpp
View file @
28e52ddb
...
...
@@ -80,7 +80,9 @@ bool X11Factory::init()
m_resourcePath
.
push_back
(
(
string
)
datadir
+
"/skins2"
);
free
(
datadir
);
m_resourcePath
.
push_back
(
(
string
)
"share/skins2"
);
m_resourcePath
.
push_back
(
(
string
)
config_GetDataDir
()
+
"/skins2"
);
datadir
=
config_GetDataDir
(
getIntf
()
);
m_resourcePath
.
push_back
(
(
string
)
datadir
+
"/skins2"
);
free
(
datadir
);
return
true
;
}
...
...
modules/misc/lua/intf.c
View file @
28e52ddb
...
...
@@ -57,11 +57,11 @@ static const char * const ppsz_intf_options[] = { "intf", "config", NULL };
/*****************************************************************************
*
*****************************************************************************/
static
char
*
FindFile
(
const
char
*
psz_name
)
static
char
*
FindFile
(
vlc_object_t
*
p_this
,
const
char
*
psz_name
)
{
char
*
ppsz_dir_list
[]
=
{
NULL
,
NULL
,
NULL
,
NULL
};
char
**
ppsz_dir
;
vlclua_dir_list
(
"intf"
,
ppsz_dir_list
);
vlclua_dir_list
(
p_this
,
"intf"
,
ppsz_dir_list
);
for
(
ppsz_dir
=
ppsz_dir_list
;
*
ppsz_dir
;
ppsz_dir
++
)
{
char
*
psz_filename
;
...
...
@@ -162,7 +162,7 @@ int Open_LuaIntf( vlc_object_t *p_this )
return
VLC_ENOMEM
;
}
p_sys
=
p_intf
->
p_sys
;
p_sys
->
psz_filename
=
FindFile
(
psz_name
);
p_sys
->
psz_filename
=
FindFile
(
p
_this
,
p
sz_name
);
if
(
!
p_sys
->
psz_filename
)
{
msg_Err
(
p_intf
,
"Couldn't find lua interface script
\"
%s
\"
."
,
...
...
modules/misc/lua/libs/misc.c
View file @
28e52ddb
...
...
@@ -114,7 +114,9 @@ static int vlclua_quit( lua_State *L )
*****************************************************************************/
static
int
vlclua_datadir
(
lua_State
*
L
)
{
lua_pushstring
(
L
,
config_GetDataDir
()
);
char
*
psz_data
=
config_GetDataDir
(
vlclua_get_this
(
L
)
);
lua_pushstring
(
L
,
psz_data
);
free
(
psz_data
);
return
1
;
}
...
...
@@ -157,7 +159,8 @@ static int vlclua_datadir_list( lua_State *L )
char
**
ppsz_dir
=
ppsz_dir_list
;
int
i
=
1
;
if
(
vlclua_dir_list
(
psz_dirname
,
ppsz_dir_list
)
!=
VLC_SUCCESS
)
if
(
vlclua_dir_list
(
vlclua_get_this
(
L
),
psz_dirname
,
ppsz_dir_list
)
!=
VLC_SUCCESS
)
return
0
;
lua_newtable
(
L
);
for
(
;
*
ppsz_dir
;
ppsz_dir
++
)
...
...
modules/misc/lua/libs/net.c
View file @
28e52ddb
...
...
@@ -132,7 +132,7 @@ static int vlclua_net_accept( lua_State *L )
int
i_fd
=
-
1
;
unsigned
int
i_count
=
1
;
while
(
pi_fd
[
0
][
i_count
]
!=
-
1
)
while
(
pi_fd
[
i_count
]
!=
-
1
)
i_count
++
;
struct
pollfd
ufd
[
i_count
+
1
];
...
...
modules/misc/lua/vlc.c
View file @
28e52ddb
...
...
@@ -105,7 +105,7 @@ static int file_compare( const char **a, const char **b )
return
strcmp
(
*
a
,
*
b
);
}
int
vlclua_dir_list
(
const
char
*
luadirname
,
char
**
ppsz_dir_list
)
int
vlclua_dir_list
(
vlc_object_t
*
p_this
,
const
char
*
luadirname
,
char
**
ppsz_dir_list
)
{
int
i
=
0
;
char
*
datadir
=
config_GetUserDir
(
VLC_DATA_DIR
);
...
...
@@ -121,25 +121,26 @@ int vlclua_dir_list( const char *luadirname, char **ppsz_dir_list )
free
(
datadir
);
i
++
;
char
*
psz_datapath
=
config_GetDataDir
(
p_this
);
# if defined(__APPLE__) || defined(SYS_BEOS) || defined(WIN32)
{
const
char
*
psz_vlcpath
=
config_GetDataDir
();
if
(
asprintf
(
&
ppsz_dir_list
[
i
],
"%s"
DIR_SEP
"lua"
DIR_SEP
"%s"
,
psz_
vlc
path
,
luadirname
)
<
0
)
psz_
data
path
,
luadirname
)
<
0
)
return
VLC_ENOMEM
;
i
++
;
if
(
asprintf
(
&
ppsz_dir_list
[
i
],
"%s"
DIR_SEP
"share"
DIR_SEP
"lua"
DIR_SEP
"%s"
,
psz_
vlc
path
,
luadirname
)
<
0
)
psz_
data
path
,
luadirname
)
<
0
)
return
VLC_ENOMEM
;
i
++
;
}
# else
if
(
asprintf
(
&
ppsz_dir_list
[
i
],
"%s"
DIR_SEP
"lua"
DIR_SEP
"%s"
,
config_GetDataDir
()
,
luadirname
)
<
0
)
psz_datapath
,
luadirname
)
<
0
)
return
VLC_ENOMEM
;
i
++
;
# endif
free
(
psz_datapath
);
return
VLC_SUCCESS
;
}
...
...
@@ -169,7 +170,7 @@ int vlclua_scripts_batch_execute( vlc_object_t *p_this,
char
*
ppsz_dir_list
[]
=
{
NULL
,
NULL
,
NULL
,
NULL
};
char
**
ppsz_dir
;
i_ret
=
vlclua_dir_list
(
luadirname
,
ppsz_dir_list
);
i_ret
=
vlclua_dir_list
(
p_this
,
luadirname
,
ppsz_dir_list
);
if
(
i_ret
!=
VLC_SUCCESS
)
return
i_ret
;
i_ret
=
VLC_EGENERIC
;
...
...
modules/misc/lua/vlc.h
View file @
28e52ddb
...
...
@@ -105,7 +105,7 @@ int vlclua_push_ret( lua_State *, int i_error );
int
vlclua_scripts_batch_execute
(
vlc_object_t
*
p_this
,
const
char
*
luadirname
,
int
(
*
func
)(
vlc_object_t
*
,
const
char
*
,
lua_State
*
,
void
*
),
lua_State
*
L
,
void
*
user_data
);
int
vlclua_dir_list
(
const
char
*
luadirname
,
char
**
ppsz_dir_list
);
int
vlclua_dir_list
(
vlc_object_t
*
p_this
,
const
char
*
luadirname
,
char
**
ppsz_dir_list
);
void
vlclua_dir_list_free
(
char
**
ppsz_dir_list
);
/*****************************************************************************
...
...
modules/misc/notify/growl.m
View file @
28e52ddb
...
...
@@ -115,9 +115,10 @@ static int Open( vlc_object_t *p_this )
p_sys->app_name = CFSTR( "VLC media player" );
p_sys->notification_type = CFSTR( "New input playing" );
c
onst char *data_path = config_GetDataDir (
);
c
har *data_path = config_GetDataDir ( p_this
);
char buf[strlen (data_path) + sizeof ("/vlc48x48.png")];
snprintf (buf, sizeof (buf), "%s/vlc48x48.png", data_path);
free( data_path );
p_sys->default_icon = (CFDataRef) readFile( buf );
playlist_t *p_playlist = pl_Hold( p_intf );
...
...
modules/misc/notify/notify.c
View file @
28e52ddb
...
...
@@ -224,11 +224,13 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
{
GError
*
p_error
=
NULL
;
char
*
psz_pixbuf
;
if
(
asprintf
(
&
psz_pixbuf
,
"%s/vlc48x48.png"
,
config_GetDataDir
()
)
>=
0
)
char
*
psz_data
=
config_GetDataDir
(
p_this
);
if
(
asprintf
(
&
psz_pixbuf
,
"%s/vlc48x48.png"
,
psz_data
)
>=
0
)
{
pix
=
gdk_pixbuf_new_from_file
(
psz_pixbuf
,
&
p_error
);
free
(
psz_pixbuf
);
}
free
(
psz_data
);
}
free
(
psz_arturl
);
...
...
src/Makefile.am
View file @
28e52ddb
...
...
@@ -428,6 +428,7 @@ SOURCES_libvlc_common = \
config/intf.c
\
config/keys.c
\
config/cmdline.c
\
config/dirs.c
\
misc/events.c
\
misc/image.c
\
misc/messages.c
\
...
...
src/config/configuration.h
View file @
28e52ddb
...
...
@@ -45,6 +45,8 @@ void config_UnsetCallbacks( module_config_t *, size_t );
int
__config_LoadCmdLine
(
vlc_object_t
*
,
int
*
,
const
char
*
[],
bool
);
int
__config_LoadConfigFile
(
vlc_object_t
*
,
const
char
*
);
const
char
*
config_GetDataDirDefault
(
void
);
int
IsConfigStringType
(
int
type
);
int
IsConfigIntegerType
(
int
type
);
static
inline
int
IsConfigFloatType
(
int
type
)
...
...
src/config/dirs.c
0 → 100644
View file @
28e52ddb
/*****************************************************************************
* dirs.c: crossplatform directories configuration
*****************************************************************************
* Copyright (C) 2009 the VideoLAN team
*
* Authors: Antoine Cellerier <dionoea at videolan dot org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include "../libvlc.h"
#include "configuration.h"
/**
* Determines the shared data directory
*
* @return a string (always succeeds). Needs to be freed.
*/
char
*
__config_GetDataDir
(
vlc_object_t
*
p_obj
)
{
char
*
psz_path
=
config_GetPsz
(
p_obj
,
"data-path"
);
if
(
psz_path
&&
*
psz_path
)
return
psz_path
;
free
(
psz_path
);
return
strdup
(
config_GetDataDirDefault
()
);
}
src/config/dirs_macos.c
View file @
28e52ddb
...
...
@@ -49,7 +49,7 @@ const char *config_GetConfDir( void )
return
configdir
;
}
const
char
*
config_GetDataDir
(
void
)
const
char
*
config_GetDataDir
Default
(
void
)
{
pthread_once
(
&
once
,
init_dirs
);
return
datadir
;
...
...
src/config/dirs_win.c
View file @
28e52ddb
...
...
@@ -43,7 +43,7 @@
#include <assert.h>
#include <limits.h>
const
char
*
config_GetDataDir
(
void
)
const
char
*
config_GetDataDir
Default
(
void
)
{
static
char
path
[
PATH_MAX
]
=
""
;
#warning FIXME: thread-safety!
...
...
src/config/dirs_xdg.c
View file @
28e52ddb
...
...
@@ -40,7 +40,7 @@
*
* @return a string (always succeeds).
*/
const
char
*
config_GetDataDir
(
void
)
const
char
*
config_GetDataDir
Default
(
void
)
{
return
DATA_PATH
;
}
...
...
src/libvlc-module.c
View file @
28e52ddb
...
...
@@ -1120,6 +1120,10 @@ static const char *const ppsz_clock_descriptions[] =
"Additional path for VLC to look for its modules. You can add " \
"several paths by concatenating them using \" PATH_SEP \" as separator")
#define DATA_PATH_TEXT N_("Data search path")
#define DATA_PATH_LONGTEXT N_( \
"Override the default data/share search path.")
#define VLM_CONF_TEXT N_("VLM configuration file")
#define VLM_CONF_LONGTEXT N_( \
"Read a VLM configuration file as soon as VLM is started." )
...
...
@@ -2033,6 +2037,9 @@ vlc_module_begin ()
add_directory
(
"plugin-path"
,
NULL
,
NULL
,
PLUGIN_PATH_TEXT
,
PLUGIN_PATH_LONGTEXT
,
true
)
change_need_restart
()
add_directory
(
"data-path"
,
NULL
,
NULL
,
DATA_PATH_TEXT
,
DATA_PATH_LONGTEXT
,
true
)
change_need_restart
()
set_section
(
N_
(
"Performance options"
),
NULL
)
add_obsolete_bool
(
"minimize-threads"
)
...
...
src/libvlccore.sym
View file @
28e52ddb
...
...
@@ -52,7 +52,7 @@ __config_ChainParse
__config_ExistIntf
config_FindConfig
config_GetConfDir
config_GetDataDir
__
config_GetDataDir
__config_GetFloat
config_GetUserDir
__config_GetInt
...
...
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