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
bc1fa152
Commit
bc1fa152
authored
Jan 01, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libvlc: look the value of intf up only once when used
parent
d19530bc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
19 deletions
+14
-19
src/interface/interface.c
src/interface/interface.c
+3
-8
src/libvlc.c
src/libvlc.c
+11
-11
No files found.
src/interface/interface.c
View file @
bc1fa152
...
@@ -102,15 +102,10 @@ int intf_Create( vlc_object_t *p_this, const char *chain )
...
@@ -102,15 +102,10 @@ int intf_Create( vlc_object_t *p_this, const char *chain )
var_AddCallback
(
p_intf
,
"intf-add"
,
AddIntfCallback
,
NULL
);
var_AddCallback
(
p_intf
,
"intf-add"
,
AddIntfCallback
,
NULL
);
/* Choose the best module */
/* Choose the best module */
p_intf
->
p_cfg
=
NULL
;
char
*
psz_parser
=
*
chain
==
'$'
?
var_CreateGetString
(
p_intf
,
chain
+
1
)
:
strdup
(
chain
);
char
*
module
;
char
*
module
;
char
*
psz_tmp
=
config_ChainCreate
(
&
module
,
&
p_intf
->
p_cfg
,
psz_parser
);
p_intf
->
p_cfg
=
NULL
;
free
(
psz_tmp
);
free
(
config_ChainCreate
(
&
module
,
&
p_intf
->
p_cfg
,
chain
)
);
free
(
psz_parser
);
p_intf
->
p_module
=
module_need
(
p_intf
,
"interface"
,
module
,
true
);
p_intf
->
p_module
=
module_need
(
p_intf
,
"interface"
,
module
,
true
);
free
(
module
);
free
(
module
);
if
(
p_intf
->
p_module
==
NULL
)
if
(
p_intf
->
p_module
==
NULL
)
...
...
src/libvlc.c
View file @
bc1fa152
...
@@ -594,17 +594,19 @@ void libvlc_InternalDestroy( libvlc_int_t *p_libvlc )
...
@@ -594,17 +594,19 @@ void libvlc_InternalDestroy( libvlc_int_t *p_libvlc )
/**
/**
* Add an interface plugin and run it
* Add an interface plugin and run it
*/
*/
int
libvlc_InternalAddIntf
(
libvlc_int_t
*
p_libvlc
,
c
har
const
*
psz_modul
e
)
int
libvlc_InternalAddIntf
(
libvlc_int_t
*
p_libvlc
,
c
onst
char
*
nam
e
)
{
{
int
ret
;
if
(
!
p_libvlc
)
if
(
!
p_libvlc
)
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
if
(
psz_module
==
NULL
)
/* requesting the default interface */
if
(
name
!=
NULL
)
{
ret
=
intf_Create
(
p_libvlc
,
name
);
else
{
/* Default interface */
char
*
intf
=
var_InheritString
(
p_libvlc
,
"intf"
);
char
*
intf
=
var_InheritString
(
p_libvlc
,
"intf"
);
if
(
intf
!=
NULL
)
/* "intf" has not been set */
if
(
intf
==
NULL
)
/* "intf" has not been set */
free
(
intf
);
else
{
{
char
*
pidfile
=
var_InheritString
(
p_libvlc
,
"pidfile"
);
char
*
pidfile
=
var_InheritString
(
p_libvlc
,
"pidfile"
);
if
(
pidfile
!=
NULL
)
if
(
pidfile
!=
NULL
)
...
@@ -614,13 +616,11 @@ int libvlc_InternalAddIntf( libvlc_int_t *p_libvlc, char const *psz_module )
...
@@ -614,13 +616,11 @@ int libvlc_InternalAddIntf( libvlc_int_t *p_libvlc, char const *psz_module )
_
(
"Running vlc with the default interface. "
_
(
"Running vlc with the default interface. "
"Use 'cvlc' to use vlc without interface."
)
);
"Use 'cvlc' to use vlc without interface."
)
);
}
}
ret
=
intf_Create
(
p_libvlc
,
intf
);
name
=
"default"
;
}
}
/* Try to create the interface */
int
ret
=
intf_Create
(
p_libvlc
,
psz_module
?
psz_module
:
"$intf"
);
if
(
ret
)
if
(
ret
)
msg_Err
(
p_libvlc
,
"interface
\"
%s
\"
initialization failed"
,
msg_Err
(
p_libvlc
,
"interface
\"
%s
\"
initialization failed"
,
name
);
psz_module
?
psz_module
:
"default"
);
return
ret
;
return
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