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
f0040526
Commit
f0040526
authored
Dec 10, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: config_GetPsz -> var_CreateGetNonEmptyString
parent
fb1a1c12
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
48 deletions
+56
-48
src/audio_output/aout_internal.h
src/audio_output/aout_internal.h
+4
-1
src/config/file.c
src/config/file.c
+2
-1
src/libvlc.c
src/libvlc.c
+24
-25
src/video_output/vout_intf.c
src/video_output/vout_intf.c
+26
-21
No files found.
src/audio_output/aout_internal.h
View file @
f0040526
...
@@ -269,7 +269,10 @@ static inline bool AoutChangeFilterString( vlc_object_t *p_obj, aout_instance_t
...
@@ -269,7 +269,10 @@ static inline bool AoutChangeFilterString( vlc_object_t *p_obj, aout_instance_t
if
(
p_aout
)
if
(
p_aout
)
psz_val
=
var_GetString
(
p_aout
,
psz_variable
);
psz_val
=
var_GetString
(
p_aout
,
psz_variable
);
else
else
psz_val
=
config_GetPsz
(
p_obj
,
"audio-filter"
);
{
psz_val
=
var_CreateGetString
(
p_obj
->
p_libvlc
,
"audio-filter"
);
var_Destroy
(
p_obj
->
p_libvlc
,
"audio-filter"
);
}
if
(
!
psz_val
)
if
(
!
psz_val
)
psz_val
=
strdup
(
""
);
psz_val
=
strdup
(
""
);
...
...
src/config/file.c
View file @
f0040526
...
@@ -54,7 +54,8 @@ static inline char *strdupnull (const char *src)
...
@@ -54,7 +54,8 @@ static inline char *strdupnull (const char *src)
*/
*/
static
char
*
config_GetConfigFile
(
vlc_object_t
*
obj
)
static
char
*
config_GetConfigFile
(
vlc_object_t
*
obj
)
{
{
char
*
psz_file
=
config_GetPsz
(
obj
,
"config"
);
char
*
psz_file
=
var_CreateGetNonEmptyString
(
obj
,
"config"
);
var_Destroy
(
obj
,
"config"
);
if
(
psz_file
==
NULL
)
if
(
psz_file
==
NULL
)
{
{
char
*
psz_dir
=
config_GetUserDir
(
VLC_CONFIG_DIR
);
char
*
psz_dir
=
config_GetUserDir
(
VLC_CONFIG_DIR
);
...
...
src/libvlc.c
View file @
f0040526
...
@@ -369,7 +369,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
...
@@ -369,7 +369,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
b_daemon
=
true
;
b_daemon
=
true
;
/* lets check if we need to write the pidfile */
/* lets check if we need to write the pidfile */
psz_pidfile
=
config_GetPsz
(
p_libvlc
,
"pidfile"
);
psz_pidfile
=
var_CreateGetNonEmptyString
(
p_libvlc
,
"pidfile"
);
if
(
psz_pidfile
!=
NULL
)
if
(
psz_pidfile
!=
NULL
)
{
{
FILE
*
pidfile
;
FILE
*
pidfile
;
...
@@ -438,8 +438,8 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
...
@@ -438,8 +438,8 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
priv
->
i_verbose
=
config_GetInt
(
p_libvlc
,
"verbose"
);
priv
->
i_verbose
=
config_GetInt
(
p_libvlc
,
"verbose"
);
/* Check if the user specified a custom language */
/* Check if the user specified a custom language */
psz_language
=
config_GetPsz
(
p_libvlc
,
"language"
);
psz_language
=
var_CreateGetNonEmptyString
(
p_libvlc
,
"language"
);
if
(
psz_language
&&
*
psz_language
&&
strcmp
(
psz_language
,
"auto"
)
)
if
(
psz_language
&&
strcmp
(
psz_language
,
"auto"
)
)
{
{
/* Reset the default domain */
/* Reset the default domain */
SetLanguage
(
psz_language
);
SetLanguage
(
psz_language
);
...
@@ -482,7 +482,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
...
@@ -482,7 +482,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
abort
();
abort
();
}
}
/* Check for help on modules */
/* Check for help on modules */
if
(
(
p_tmp
=
config_GetPsz
(
p_libvlc
,
"module"
))
)
if
(
(
p_tmp
=
var_CreateGetNonEmptyString
(
p_libvlc
,
"module"
))
)
{
{
Help
(
p_libvlc
,
p_tmp
);
Help
(
p_libvlc
,
p_tmp
);
free
(
p_tmp
);
free
(
p_tmp
);
...
@@ -696,7 +696,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
...
@@ -696,7 +696,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
/*
/*
* Message queue options
* Message queue options
*/
*/
char
*
psz_verbose_objects
=
config_GetPsz
(
p_libvlc
,
"verbose-objects"
);
char
*
psz_verbose_objects
=
var_CreateGetNonEmptyString
(
p_libvlc
,
"verbose-objects"
);
if
(
psz_verbose_objects
)
if
(
psz_verbose_objects
)
{
{
char
*
psz_object
,
*
iter
=
psz_verbose_objects
;
char
*
psz_object
,
*
iter
=
psz_verbose_objects
;
...
@@ -851,8 +851,8 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
...
@@ -851,8 +851,8 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
vlc_object_attach
(
p_playlist
,
p_libvlc
);
vlc_object_attach
(
p_playlist
,
p_libvlc
);
/* Add service discovery modules */
/* Add service discovery modules */
psz_modules
=
config_GetPsz
(
p_playlist
,
"services-discovery"
);
psz_modules
=
var_CreateGetNonEmptyString
(
p_playlist
,
"services-discovery"
);
if
(
psz_modules
&&
*
psz_modules
)
if
(
psz_modules
)
{
{
char
*
p
=
psz_modules
,
*
m
;
char
*
p
=
psz_modules
,
*
m
;
while
(
(
m
=
strsep
(
&
p
,
" :,"
)
)
!=
NULL
)
while
(
(
m
=
strsep
(
&
p
,
" :,"
)
)
!=
NULL
)
...
@@ -862,8 +862,8 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
...
@@ -862,8 +862,8 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
#ifdef ENABLE_VLM
#ifdef ENABLE_VLM
/* Initialize VLM if vlm-conf is specified */
/* Initialize VLM if vlm-conf is specified */
psz_parser
=
config_GetPsz
(
p_libvlc
,
"vlm-conf"
);
psz_parser
=
var_CreateGetNonEmptyString
(
p_libvlc
,
"vlm-conf"
);
if
(
psz_parser
&&
*
psz_parser
)
if
(
psz_parser
)
{
{
priv
->
p_vlm
=
vlm_New
(
p_libvlc
);
priv
->
p_vlm
=
vlm_New
(
p_libvlc
);
if
(
!
priv
->
p_vlm
)
if
(
!
priv
->
p_vlm
)
...
@@ -879,10 +879,10 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
...
@@ -879,10 +879,10 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
all interfaces as they can use it) */
all interfaces as they can use it) */
var_Create
(
p_libvlc
,
"volume-change"
,
VLC_VAR_BOOL
);
var_Create
(
p_libvlc
,
"volume-change"
,
VLC_VAR_BOOL
);
psz_modules
=
config_GetPsz
(
p_libvlc
,
"extraintf"
);
psz_modules
=
var_CreateGetNonEmptyString
(
p_libvlc
,
"extraintf"
);
psz_control
=
config_GetPsz
(
p_libvlc
,
"control"
);
psz_control
=
var_CreateGetNonEmptyString
(
p_libvlc
,
"control"
);
if
(
psz_modules
&&
*
psz_modules
&&
psz_control
&&
*
psz_control
)
if
(
psz_modules
&&
psz_control
)
{
{
char
*
psz_tmp
;
char
*
psz_tmp
;
if
(
asprintf
(
&
psz_tmp
,
"%s:%s"
,
psz_modules
,
psz_control
)
!=
-
1
)
if
(
asprintf
(
&
psz_tmp
,
"%s:%s"
,
psz_modules
,
psz_control
)
!=
-
1
)
...
@@ -891,7 +891,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
...
@@ -891,7 +891,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
psz_modules
=
psz_tmp
;
psz_modules
=
psz_tmp
;
}
}
}
}
else
if
(
psz_control
&&
*
psz_control
)
else
if
(
psz_control
)
{
{
free
(
psz_modules
);
free
(
psz_modules
);
psz_modules
=
strdup
(
psz_control
);
psz_modules
=
strdup
(
psz_control
);
...
@@ -968,19 +968,19 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
...
@@ -968,19 +968,19 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
#ifdef WIN32
#ifdef WIN32
if
(
config_GetInt
(
p_libvlc
,
"prefer-system-codecs"
)
>
0
)
if
(
config_GetInt
(
p_libvlc
,
"prefer-system-codecs"
)
>
0
)
{
{
char
*
psz_codecs
=
config_GetPsz
(
p_playlist
,
"codec"
);
char
*
psz_codecs
=
var_CreateGetNonEmptyString
(
p_playlist
,
"codec"
);
if
(
psz_codecs
)
if
(
psz_codecs
)
{
{
char
*
psz_morecodecs
;
char
*
psz_morecodecs
;
if
(
asprintf
(
&
psz_morecodecs
,
"%s,dmo,quicktime"
,
psz_codecs
)
!=
-
1
)
if
(
asprintf
(
&
psz_morecodecs
,
"%s,dmo,quicktime"
,
psz_codecs
)
!=
-
1
)
{
{
config_PutPsz
(
p_libvlc
,
"codec"
,
psz_morecodecs
);
var_SetString
(
p_libvlc
,
"codec"
,
psz_morecodecs
);
free
(
psz_morecodecs
);
free
(
psz_morecodecs
);
}
}
free
(
psz_codecs
);
}
}
else
else
config_PutPsz
(
p_libvlc
,
"codec"
,
"dmo,quicktime"
);
var_SetString
(
p_libvlc
,
"codec"
,
"dmo,quicktime"
);
free
(
psz_codecs
);
}
}
#endif
#endif
...
@@ -1071,7 +1071,7 @@ void libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
...
@@ -1071,7 +1071,7 @@ void libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
if
(
b_daemon
)
if
(
b_daemon
)
{
{
psz_pidfile
=
config_GetPsz
(
p_libvlc
,
"pidfile"
);
psz_pidfile
=
var_CreateGetNonEmptyString
(
p_libvlc
,
"pidfile"
);
if
(
psz_pidfile
!=
NULL
)
if
(
psz_pidfile
!=
NULL
)
{
{
msg_Dbg
(
p_libvlc
,
"removing pid file %s"
,
psz_pidfile
);
msg_Dbg
(
p_libvlc
,
"removing pid file %s"
,
psz_pidfile
);
...
@@ -1146,8 +1146,8 @@ int libvlc_InternalAddIntf( libvlc_int_t *p_libvlc, char const *psz_module )
...
@@ -1146,8 +1146,8 @@ int libvlc_InternalAddIntf( libvlc_int_t *p_libvlc, char const *psz_module )
if
(
!
psz_module
)
/* requesting the default interface */
if
(
!
psz_module
)
/* requesting the default interface */
{
{
char
*
psz_interface
=
config_GetPsz
(
p_libvlc
,
"intf"
);
char
*
psz_interface
=
var_CreateGetNonEmptyString
(
p_libvlc
,
"intf"
);
if
(
!
psz_interface
||
!*
psz_interface
)
/* "intf" has not been set */
if
(
!
psz_interface
)
/* "intf" has not been set */
{
{
#ifndef WIN32
#ifndef WIN32
if
(
b_daemon
)
if
(
b_daemon
)
...
@@ -1164,13 +1164,12 @@ int libvlc_InternalAddIntf( libvlc_int_t *p_libvlc, char const *psz_module )
...
@@ -1164,13 +1164,12 @@ int libvlc_InternalAddIntf( libvlc_int_t *p_libvlc, char const *psz_module )
}
}
/* Try to create the interface */
/* Try to create the interface */
i
f
(
intf_Create
(
p_libvlc
,
psz_module
?
psz_module
:
"$intf"
)
)
i
nt
ret
=
intf_Create
(
p_libvlc
,
psz_module
?
psz_module
:
"$intf"
);
{
if
(
ret
)
msg_Err
(
p_libvlc
,
"interface
\"
%s
\"
initialization failed"
,
msg_Err
(
p_libvlc
,
"interface
\"
%s
\"
initialization failed"
,
psz_module
?
psz_module
:
"default"
);
psz_module
?
psz_module
:
"default"
);
return
VLC_EGENERIC
;
var_Destroy
(
p_libvlc
,
"intf"
);
}
return
ret
;
return
VLC_SUCCESS
;
}
}
static
vlc_mutex_t
exit_lock
=
VLC_STATIC_MUTEX
;
static
vlc_mutex_t
exit_lock
=
VLC_STATIC_MUTEX
;
...
...
src/video_output/vout_intf.c
View file @
f0040526
...
@@ -129,24 +129,23 @@ static const struct
...
@@ -129,24 +129,23 @@ static const struct
static
void
AddCustomRatios
(
vout_thread_t
*
p_vout
,
const
char
*
psz_var
,
static
void
AddCustomRatios
(
vout_thread_t
*
p_vout
,
const
char
*
psz_var
,
char
*
psz_list
)
char
*
psz_list
)
{
{
if
(
psz_list
&&
*
psz_list
)
assert
(
psz_list
);
char
*
psz_cur
=
psz_list
;
char
*
psz_next
;
while
(
psz_cur
&&
*
psz_cur
)
{
{
char
*
psz_cur
=
psz_lis
t
;
vlc_value_t
val
,
tex
t
;
char
*
psz_next
;
psz_next
=
strchr
(
psz_cur
,
','
)
;
while
(
psz_cur
&&
*
psz_cur
)
if
(
psz_next
)
{
{
vlc_value_t
val
,
text
;
*
psz_next
=
'\0'
;
psz_next
=
strchr
(
psz_cur
,
','
);
psz_next
++
;
if
(
psz_next
)
{
*
psz_next
=
'\0'
;
psz_next
++
;
}
val
.
psz_string
=
psz_cur
;
text
.
psz_string
=
psz_cur
;
var_Change
(
p_vout
,
psz_var
,
VLC_VAR_ADDCHOICE
,
&
val
,
&
text
);
psz_cur
=
psz_next
;
}
}
val
.
psz_string
=
psz_cur
;
text
.
psz_string
=
psz_cur
;
var_Change
(
p_vout
,
psz_var
,
VLC_VAR_ADDCHOICE
,
&
val
,
&
text
);
psz_cur
=
psz_next
;
}
}
}
}
...
@@ -244,9 +243,12 @@ void vout_IntfInit( vout_thread_t *p_vout )
...
@@ -244,9 +243,12 @@ void vout_IntfInit( vout_thread_t *p_vout )
var_Create
(
p_vout
,
"crop-update"
,
VLC_VAR_VOID
);
var_Create
(
p_vout
,
"crop-update"
,
VLC_VAR_VOID
);
/* Add custom crop ratios */
/* Add custom crop ratios */
psz_buf
=
config_GetPsz
(
p_vout
,
"custom-crop-ratios"
);
psz_buf
=
var_CreateGetNonEmptyString
(
p_vout
,
"custom-crop-ratios"
);
AddCustomRatios
(
p_vout
,
"crop"
,
psz_buf
);
if
(
psz_buf
)
free
(
psz_buf
);
{
AddCustomRatios
(
p_vout
,
"crop"
,
psz_buf
);
free
(
psz_buf
);
}
var_AddCallback
(
p_vout
,
"crop"
,
CropCallback
,
NULL
);
var_AddCallback
(
p_vout
,
"crop"
,
CropCallback
,
NULL
);
var_Get
(
p_vout
,
"crop"
,
&
old_val
);
var_Get
(
p_vout
,
"crop"
,
&
old_val
);
...
@@ -305,9 +307,12 @@ void vout_IntfInit( vout_thread_t *p_vout )
...
@@ -305,9 +307,12 @@ void vout_IntfInit( vout_thread_t *p_vout )
}
}
/* Add custom aspect ratios */
/* Add custom aspect ratios */
psz_buf
=
config_GetPsz
(
p_vout
,
"custom-aspect-ratios"
);
psz_buf
=
var_CreateGetNonEmptyString
(
p_vout
,
"custom-aspect-ratios"
);
AddCustomRatios
(
p_vout
,
"aspect-ratio"
,
psz_buf
);
if
(
psz_buf
)
free
(
psz_buf
);
{
AddCustomRatios
(
p_vout
,
"aspect-ratio"
,
psz_buf
);
free
(
psz_buf
);
}
var_AddCallback
(
p_vout
,
"aspect-ratio"
,
AspectCallback
,
NULL
);
var_AddCallback
(
p_vout
,
"aspect-ratio"
,
AspectCallback
,
NULL
);
var_Get
(
p_vout
,
"aspect-ratio"
,
&
old_val
);
var_Get
(
p_vout
,
"aspect-ratio"
,
&
old_val
);
...
...
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