Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libjitsi
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ZRTP
libjitsi
Commits
cfe766cd
Commit
cfe766cd
authored
11 years ago
by
Lyubomir Marinov
Browse files
Options
Downloads
Patches
Plain Diff
Fixes a dealock in the Windows Audio Session API (WASAPI) backend. Reported by Ingo Bauersachs.
parent
2b5119b0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/org/jitsi/impl/neomedia/jmfext/media/protocol/wasapi/WASAPIStream.java
+30
-1
30 additions, 1 deletion
...l/neomedia/jmfext/media/protocol/wasapi/WASAPIStream.java
with
30 additions
and
1 deletion
src/org/jitsi/impl/neomedia/jmfext/media/protocol/wasapi/WASAPIStream.java
+
30
−
1
View file @
cfe766cd
...
@@ -1169,7 +1169,12 @@ private AudioFormat doConnectInSourceMode(
...
@@ -1169,7 +1169,12 @@ private AudioFormat doConnectInSourceMode(
@Override
@Override
protected
Format
doGetFormat
()
protected
Format
doGetFormat
()
{
{
return
(
format
==
null
)
?
super
.
doGetFormat
()
:
format
;
synchronized
(
this
)
{
if
(
format
!=
null
)
return
format
;
}
return
super
.
doGetFormat
();
}
}
/**
/**
...
@@ -1342,6 +1347,30 @@ private AudioFormat findClosestMatchCaptureSupportedFormat(
...
@@ -1342,6 +1347,30 @@ private AudioFormat findClosestMatchCaptureSupportedFormat(
NativelySupportedAudioFormat
.
class
);
NativelySupportedAudioFormat
.
class
);
}
}
/**
* {@inheritDoc}
*
* Overrides the super implementation to avoid a deadlock with
* {@link #stop()}. The <tt>stop()</tt> method is generally invoked with a
* certain synchronization root locked, the implementation of
* <tt>WASAPIStream</tt> waits for {@link #processThread} to quit but
* <tt>processThread</tt> indirectly invokes
* {@link AbstractPushBufferStream#getFormat()} which in turn results in an
* attempt to lock the mentioned synchronization root i.e. the thread
* invoking the <tt>stop()</tt> method and <tt>processThread</tt> fall into
* a deadlock.
*/
@Override
public
Format
getFormat
()
{
synchronized
(
this
)
{
if
(
format
!=
null
)
return
format
;
}
return
super
.
getFormat
();
}
/**
/**
* Gets the <tt>MediaLocator</tt> of this instance which identifies the
* Gets the <tt>MediaLocator</tt> of this instance which identifies the
* audio endpoint device this <tt>SourceStream</tt> is to capture data from.
* audio endpoint device this <tt>SourceStream</tt> is to capture data from.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment