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
f45691bd
Commit
f45691bd
authored
Dec 20, 2009
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sout_announce: use a static mutex instead of a variable.
parent
fd3aa03e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
12 deletions
+7
-12
src/stream_output/announce.c
src/stream_output/announce.c
+7
-12
No files found.
src/stream_output/announce.c
View file @
f45691bd
...
...
@@ -49,6 +49,9 @@ static void sap_destroy (vlc_object_t *p_this)
}
#undef sout_AnnounceRegisterSDP
static
vlc_mutex_t
sap_mutex
=
VLC_STATIC_MUTEX
;
/**
* Registers a new session with the announce handler, using a pregenerated SDP
*
...
...
@@ -81,12 +84,7 @@ sout_AnnounceRegisterSDP( vlc_object_t *obj, const char *psz_sdp,
vlc_freeaddrinfo
(
res
);
}
vlc_value_t
lockval
;
if
(
var_Create
(
obj
->
p_libvlc
,
"sap_mutex"
,
VLC_VAR_MUTEX
)
||
var_Get
(
obj
->
p_libvlc
,
"sap_mutex"
,
&
lockval
))
goto
error
;
vlc_mutex_lock
(
lockval
.
p_address
);
vlc_mutex_lock
(
&
sap_mutex
);
sap_handler_t
*
p_sap
=
libvlc_priv
(
obj
->
p_libvlc
)
->
p_sap
;
if
(
p_sap
==
NULL
)
{
...
...
@@ -96,7 +94,7 @@ sout_AnnounceRegisterSDP( vlc_object_t *obj, const char *psz_sdp,
}
else
vlc_object_hold
((
vlc_object_t
*
)
p_sap
);
vlc_mutex_unlock
(
lockval
.
p_address
);
vlc_mutex_unlock
(
&
sap_mutex
);
if
(
p_sap
==
NULL
)
goto
error
;
...
...
@@ -127,12 +125,9 @@ int sout_AnnounceUnRegister( vlc_object_t *obj,
msg_Dbg
(
obj
,
"removing SAP session"
);
SAP_Del
(
p_sap
,
p_session
);
vlc_value_t
lockval
;
var_Create
(
obj
->
p_libvlc
,
"sap_mutex"
,
VLC_VAR_MUTEX
);
var_Get
(
obj
->
p_libvlc
,
"sap_mutex"
,
&
lockval
);
vlc_mutex_lock
(
lockval
.
p_address
);
vlc_mutex_lock
(
&
sap_mutex
);
vlc_object_release
((
vlc_object_t
*
)
p_sap
);
vlc_mutex_unlock
(
lockval
.
p_address
);
vlc_mutex_unlock
(
&
sap_mutex
);
free
(
p_session
->
psz_sdp
);
free
(
p_session
);
...
...
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