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
cc69b318
Commit
cc69b318
authored
Aug 16, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netsync: fix and simplify dead input handling (fixes #5426)
parent
a7342143
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
26 deletions
+16
-26
modules/control/netsync.c
modules/control/netsync.c
+16
-26
No files found.
modules/control/netsync.c
View file @
cc69b318
...
...
@@ -151,8 +151,13 @@ void Close(vlc_object_t *object)
intf_thread_t
*
intf
=
(
intf_thread_t
*
)
object
;
intf_sys_t
*
sys
=
intf
->
p_sys
;
assert
(
sys
->
input
==
NULL
);
var_DelCallback
(
sys
->
playlist
,
"input-current"
,
PlaylistEvent
,
intf
);
if
(
sys
->
input
!=
NULL
)
{
vlc_cancel
(
sys
->
thread
);
vlc_join
(
sys
->
thread
,
NULL
);
}
net_Close
(
sys
->
fd
);
free
(
sys
);
}
...
...
@@ -266,43 +271,28 @@ static void *Slave(void *handle)
return
NULL
;
}
static
int
Inpu
tEvent
(
vlc_object_t
*
object
,
char
const
*
cmd
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
data
)
static
int
Playlis
tEvent
(
vlc_object_t
*
object
,
char
const
*
cmd
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
data
)
{
VLC_UNUSED
(
cmd
);
VLC_UNUSED
(
o
ldval
);
VLC_UNUSED
(
o
bject
);
VLC_UNUSED
(
cmd
);
VLC_UNUSED
(
object
);
intf_thread_t
*
intf
=
data
;
intf_sys_t
*
sys
=
intf
->
p_sys
;
input_thread_t
*
input
=
newval
.
p_address
;
if
(
newval
.
i_int
==
INPUT_EVENT_DEAD
&&
sys
->
input
)
{
if
(
sys
->
input
!=
NULL
)
{
msg_Err
(
intf
,
"InputEvent DEAD"
);
assert
(
oldval
.
p_address
==
sys
->
input
);
vlc_cancel
(
sys
->
thread
);
vlc_join
(
sys
->
thread
,
NULL
);
vlc_object_release
(
sys
->
input
);
sys
->
input
=
NULL
;
}
return
VLC_SUCCESS
;
}
static
int
PlaylistEvent
(
vlc_object_t
*
object
,
char
const
*
cmd
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
data
)
{
VLC_UNUSED
(
cmd
);
VLC_UNUSED
(
oldval
);
VLC_UNUSED
(
object
);
intf_thread_t
*
intf
=
data
;
intf_sys_t
*
sys
=
intf
->
p_sys
;
input_thread_t
*
input
=
newval
.
p_address
;
sys
->
input
=
input
;
assert
(
sys
->
input
==
NULL
);
if
(
input
!=
NULL
)
{
sys
->
input
=
vlc_object_hold
(
input
);
if
(
input
!=
NULL
)
{
if
(
vlc_clone
(
&
sys
->
thread
,
sys
->
is_master
?
Master
:
Slave
,
intf
,
VLC_THREAD_PRIORITY_INPUT
))
{
vlc_object_release
(
input
);
VLC_THREAD_PRIORITY_INPUT
))
sys
->
input
=
NULL
;
return
VLC_SUCCESS
;
}
var_AddCallback
(
input
,
"intf-event"
,
InputEvent
,
intf
);
}
return
VLC_SUCCESS
;
}
...
...
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