diff options
author | Boris Grozev <boris@jitsi.org> | 2013-06-03 14:49:40 +0300 |
---|---|---|
committer | Boris Grozev <boris@jitsi.org> | 2013-06-03 14:49:40 +0300 |
commit | 1ec286c9e6ed0e9c8ded4b9926b9cb68a80e5db5 (patch) | |
tree | ecddcbebea3526f99c34aed698a46ea609bf7f06 /src/net/java/sip/communicator | |
parent | 08eac4a69c3ca9edb46fd1174999af6472e49d6e (diff) | |
download | jitsi-1ec286c9e6ed0e9c8ded4b9926b9cb68a80e5db5.zip jitsi-1ec286c9e6ed0e9c8ded4b9926b9cb68a80e5db5.tar.gz jitsi-1ec286c9e6ed0e9c8ded4b9926b9cb68a80e5db5.tar.bz2 |
Makes sure that the MediaDevice of the MediaStream is only updated if it has
actually changed (and it's not just its MediaDeviceWrapper that changed). This
removes an unnecessary change of the MediaStream device when the focus of a
conference stops the local video (which sometimes leads to a jvm crash)
Diffstat (limited to 'src/net/java/sip/communicator')
-rw-r--r-- | src/net/java/sip/communicator/service/protocol/media/CallPeerMediaHandler.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/net/java/sip/communicator/service/protocol/media/CallPeerMediaHandler.java b/src/net/java/sip/communicator/service/protocol/media/CallPeerMediaHandler.java index 044e99b..887d0bf 100644 --- a/src/net/java/sip/communicator/service/protocol/media/CallPeerMediaHandler.java +++ b/src/net/java/sip/communicator/service/protocol/media/CallPeerMediaHandler.java @@ -361,13 +361,23 @@ public abstract class CallPeerMediaHandler<T extends MediaAwareCallPeer<?,?,?>> if (stream == null) continue; + /* + * Update the stream device, if necessary + */ MediaDevice oldDevice = stream.getDevice(); - if (oldDevice != null) { + if (oldDevice instanceof MediaDeviceWrapper) + oldDevice = ((MediaDeviceWrapper) oldDevice) + .getWrappedDevice(); + MediaDevice newDevice = getDefaultDevice(mediaType); + MediaDevice wrappedNewDevice = newDevice; + if (newDevice instanceof MediaDeviceWrapper) + wrappedNewDevice = ((MediaDeviceWrapper) newDevice) + .getWrappedDevice(); - if (oldDevice != newDevice) + if (oldDevice != wrappedNewDevice) stream.setDevice(newDevice); } |