Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
a5bad769
Commit
a5bad769
authored
May 06, 2011
by
Alexandre Savard
Browse files
[#5738] Refactor mutex protecting audiolayer
parent
a5564b30
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
sflphone-common/src/conference.cpp
View file @
a5bad769
...
...
@@ -112,7 +112,7 @@ void Conference::bindParticipant (CallID participant_id)
while
(
iter
!=
_participants
.
end
())
{
if
(
participant_id
!=
(
*
iter
))
{
Manager
::
instance
().
getAudioDriver
()
->
getMainBuffer
()
->
bindCallID
(
participant_id
,
*
iter
);
Manager
::
instance
().
getMainBuffer
()
->
bindCallID
(
participant_id
,
*
iter
);
}
iter
++
;
...
...
@@ -121,7 +121,7 @@ void Conference::bindParticipant (CallID participant_id)
}
Manager
::
instance
().
getAudioDriver
()
->
getMainBuffer
()
->
bindCallID
(
participant_id
);
Manager
::
instance
().
getMainBuffer
()
->
bindCallID
(
participant_id
);
}
...
...
sflphone-common/src/managerimpl.cpp
View file @
a5bad769
This diff is collapsed.
Click to expand it.
sflphone-common/src/managerimpl.h
View file @
a5bad769
...
...
@@ -1108,11 +1108,15 @@ class ManagerImpl
*/
bool
initAudioDriver
(
void
);
/*
ost::Mutex* getAudioLayerMutex() {
return &_audiolayer_mutex;
}
*/
/**
* Enter the mutex for the audio layer
*/
void
audioLayerMutexLock
(
void
)
{
_audiolayerMutex
.
enterMutex
();
}
/**
* Leave the mutex for audio layer
*/
void
audioLayerMutexUnlock
(
void
)
{
_audiolayerMutex
.
leaveMutex
();
}
/**
* Helper function that creates an MD5 Hash from the credential
...
...
@@ -1218,18 +1222,29 @@ class ManagerImpl
/** Mutex to protect access to code section */
ost
::
Mutex
_mutex
;
ost
::
Mutex
_audiolayer_mutex
;
/**
* Mutex used to protect audio layer
*/
ost
::
Mutex
_audiolayerMutex
;
// Multithread variable (non protected)
/**
* Multithread variable (non protected)
*/
DBusManagerImpl
*
_dbus
;
/** Waiting Call Vectors */
/**
* Waiting Call Vectors
*/
CallIDSet
_waitingCall
;
/** Protect waiting call list, access by many voip/audio threads */
/**
* Protect waiting call list, access by many voip/audio threads
*/
ost
::
Mutex
_waitingCallMutex
;
/** Number of waiting call, synchronize with waitingcall callidvector */
/**
* Number of waiting call, synchronize with waitingcall callidvector
*/
unsigned
int
_nbIncomingWaitingCall
;
/**
...
...
@@ -1254,7 +1269,7 @@ class ManagerImpl
/**
* Path of the ConfigFile
*/
std
::
string
_path
;
std
::
string
_path
;
int
_setupLoaded
;
...
...
sflphone-common/src/managerimpl_registration.cpp
View file @
a5bad769
...
...
@@ -81,9 +81,12 @@ ManagerImpl::registerAccounts()
iter
++
;
}
audioLayerMutexLock
();
// calls the client notification here in case of errors at startup...
if
(
_audiodriver
->
getErrorMessage
()
!=
-
1
)
notifyErrClient
(
_audiodriver
->
getErrorMessage
());
if
(
_audiodriver
->
getErrorMessage
()
!=
-
1
)
{
notifyErrClient
(
_audiodriver
->
getErrorMessage
());
}
audioLayerMutexUnlock
();
ASSERT
(
flag
,
true
);
...
...
@@ -120,9 +123,12 @@ ManagerImpl::initRegisterAccounts()
iter
++
;
}
audioLayerMutexLock
();
// calls the client notification here in case of errors at startup...
if
(
_audiodriver
->
getErrorMessage
()
!=
-
1
)
notifyErrClient
(
_audiodriver
->
getErrorMessage
());
if
(
_audiodriver
->
getErrorMessage
()
!=
-
1
)
{
notifyErrClient
(
_audiodriver
->
getErrorMessage
());
}
audioLayerMutexUnlock
();
ASSERT
(
flag
,
true
);
...
...
sflphone-common/src/sip/sipvoiplink.cpp
View file @
a5bad769
...
...
@@ -3491,7 +3491,10 @@ void sdp_media_update_cb (pjsip_inv_session *inv, pj_status_t status)
try
{
call
->
setAudioStart
(
true
);
Manager
::
instance
().
getAudioDriver
()
->
startStream
();
//->startStream();
Manager
::
instance
().
audioLayerMutexLock
();
Manager
::
instance
().
getAudioDriver
()
->
startStream
();
Manager
::
instance
().
audioLayerMutexUnlock
();
// udate session media only if required
if
(
pl
!=
call
->
getAudioRtp
()
->
getSessionMedia
())
{
...
...
Write
Preview
Supports
Markdown
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