Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
f645d20b
Commit
f645d20b
authored
May 23, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace intf_StopThread() with intf_DestroyAll()
parent
e509d7f8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
47 deletions
+37
-47
include/vlc_interface.h
include/vlc_interface.h
+0
-1
src/interface/interface.c
src/interface/interface.c
+35
-37
src/libvlc.c
src/libvlc.c
+1
-8
src/libvlc.h
src/libvlc.h
+1
-0
src/libvlccore.sym
src/libvlccore.sym
+0
-1
No files found.
include/vlc_interface.h
View file @
f645d20b
...
...
@@ -100,7 +100,6 @@ struct intf_dialog_args_t
*****************************************************************************/
VLC_EXPORT
(
int
,
intf_Create
,
(
vlc_object_t
*
,
const
char
*
)
);
#define intf_Create(a,b) intf_Create(VLC_OBJECT(a),b)
VLC_EXPORT
(
void
,
intf_StopThread
,
(
intf_thread_t
*
)
);
#define intf_Eject(a,b) __intf_Eject(VLC_OBJECT(a),b)
VLC_EXPORT
(
int
,
__intf_Eject
,
(
vlc_object_t
*
,
const
char
*
)
);
...
...
src/interface/interface.c
View file @
f645d20b
...
...
@@ -58,20 +58,6 @@ static void * MonitorLibVLCDeath( vlc_object_t *p_this );
static
int
AddIntfCallback
(
vlc_object_t
*
,
char
const
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
/**
* Destroy the interface after the main loop endeed.
*
* @param p_obj: the interface thread
*/
static
void
intf_Destroy
(
vlc_object_t
*
obj
)
{
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
obj
;
free
(
p_intf
->
psz_intf
);
config_ChainDestroy
(
p_intf
->
p_cfg
);
}
#undef intf_Create
/**
* Create and start an interface.
...
...
@@ -116,7 +102,6 @@ int intf_Create( vlc_object_t *p_this, const char *psz_module )
/* Attach interface to its parent object */
vlc_object_attach
(
p_intf
,
p_this
);
vlc_object_set_destructor
(
p_intf
,
intf_Destroy
);
#if defined( __APPLE__ ) || defined( WIN32 )
p_intf
->
b_should_run_on_first_thread
=
false
;
#endif
...
...
@@ -134,8 +119,7 @@ int intf_Create( vlc_object_t *p_this, const char *psz_module )
if
(
p_intf
->
p_module
==
NULL
)
{
msg_Err
(
p_intf
,
"no suitable interface module"
);
vlc_object_release
(
p_intf
);
return
VLC_EGENERIC
;
goto
error
;
}
if
(
p_intf
->
pf_run
==
NULL
)
...
...
@@ -150,19 +134,12 @@ int intf_Create( vlc_object_t *p_this, const char *psz_module )
VLC_THREAD_PRIORITY_LOW
)
)
{
msg_Err
(
p_intf
,
"cannot spawn libvlc death monitoring thread"
);
vlc_object_release
(
p_intf
);
return
VLC_ENOMEM
;
goto
error
;
}
p_intf
->
pf_run
(
p_intf
);
/* Make sure our MonitorLibVLCDeath thread exit */
vlc_object_kill
(
p_intf
);
/* It is monitoring libvlc, not the p_intf */
vlc_object_kill
(
p_intf
->
p_libvlc
);
vlc_thread_join
(
p_intf
);
vlc_object_detach
(
p_intf
);
vlc_object_release
(
p_intf
);
}
else
#endif
...
...
@@ -171,28 +148,49 @@ int intf_Create( vlc_object_t *p_this, const char *psz_module )
VLC_THREAD_PRIORITY_LOW
)
)
{
msg_Err
(
p_intf
,
"cannot spawn interface thread"
);
vlc_object_release
(
p_intf
);
return
VLC_EGENERIC
;
goto
error
;
}
return
VLC_SUCCESS
;
error:
if
(
p_intf
->
p_module
)
module_unneed
(
p_intf
,
p_intf
->
p_module
);
config_ChainDestroy
(
p_intf
->
p_cfg
);
free
(
p_intf
->
psz_intf
);
vlc_object_release
(
p_intf
);
return
VLC_EGENERIC
;
}
/**
* Stops the interface thread
*
* This function asks the interface thread to stop
* @param p_intf the interface thread
* Stops and destroys all interfaces
* @param p_libvlc the LibVLC instance
*/
void
intf_
StopThread
(
intf_thread_t
*
p_intf
)
void
intf_
DestroyAll
(
libvlc_int_t
*
p_libvlc
)
{
/* Tell the interface to die */
vlc_object_kill
(
p_intf
);
if
(
p_intf
->
pf_run
)
vlc_thread_join
(
p_intf
);
vlc_list_t
*
l
=
vlc_list_find
(
VLC_OBJECT
(
p_libvlc
),
VLC_OBJECT_INTF
,
FIND_CHILD
);
/* Tell the interfaces to die */
for
(
int
i
=
0
;
i
<
l
->
i_count
;
i
++
)
vlc_object_kill
(
l
->
p_values
[
i
].
p_object
);
/* Cleanup the interfaces */
for
(
int
i
=
0
;
i
<
l
->
i_count
;
i
++
)
{
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
l
->
p_values
[
i
].
p_object
;
if
(
p_intf
->
pf_run
)
vlc_thread_join
(
p_intf
);
module_unneed
(
p_intf
,
p_intf
->
p_module
);
free
(
p_intf
->
psz_intf
);
config_ChainDestroy
(
p_intf
->
p_cfg
);
}
module_unneed
(
p_intf
,
p_intf
->
p_module
);
/* Destroy objects */
for
(
int
i
=
0
;
i
<
l
->
i_count
;
i
++
)
vlc_object_release
(
l
->
p_values
[
i
].
p_object
);
/* for intf_Create() */
vlc_list_release
(
l
);
}
/* Following functions are local */
...
...
src/libvlc.c
View file @
f645d20b
...
...
@@ -1032,14 +1032,7 @@ void libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
/* Ask the interfaces to stop and destroy them */
msg_Dbg
(
p_libvlc
,
"removing all interfaces"
);
intf_thread_t
*
p_intf
;
while
(
(
p_intf
=
vlc_object_find
(
p_libvlc
,
VLC_OBJECT_INTF
,
FIND_CHILD
))
)
{
intf_StopThread
(
p_intf
);
vlc_object_detach
(
p_intf
);
vlc_object_release
(
p_intf
);
/* for intf_Create() */
vlc_object_release
(
p_intf
);
/* for vlc_object_find() */
}
intf_DestroyAll
(
p_libvlc
);
#ifdef ENABLE_VLM
/* Destroy VLM if created in libvlc_InternalInit */
...
...
src/libvlc.h
View file @
f645d20b
...
...
@@ -233,6 +233,7 @@ static inline libvlc_priv_t *libvlc_priv (libvlc_int_t *libvlc)
}
void
playlist_ServicesDiscoveryKillAll
(
playlist_t
*
p_playlist
);
void
intf_DestroyAll
(
libvlc_int_t
*
);
#define libvlc_stats( o ) (libvlc_priv((VLC_OBJECT(o))->p_libvlc)->b_stats)
...
...
src/libvlccore.sym
View file @
f645d20b
...
...
@@ -205,7 +205,6 @@ input_Stop
input_vaControl
intf_Create
__intf_Eject
intf_StopThread
IsUTF8
libvlc_InternalAddIntf
libvlc_InternalCleanup
...
...
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