Implemented synchronization during creation/playing/closing a remote stream.

The creation, playing and closing of remote streams are now inside
synchronized methods. This is necessary because multiple threads might
try to create and/or close the same stream at the same time.
This commit is contained in:
Mateus Dalepiane 2014-04-08 13:26:27 -03:00
parent 3d47ab67b2
commit f784f5839c

View File

@ -175,7 +175,7 @@ public class VideoApplication extends MultiThreadedApplicationAdapter {
}
@Override
public void streamPlayItemPlay(ISubscriberStream stream, IPlayItem item, boolean isLive) {
public synchronized void streamPlayItemPlay(ISubscriberStream stream, IPlayItem item, boolean isLive) {
// log w3c connect event
String streamName = item.getName();
@ -207,7 +207,7 @@ public class VideoApplication extends MultiThreadedApplicationAdapter {
}
@Override
public void streamSubscriberClose(ISubscriberStream stream) {
public synchronized void streamSubscriberClose(ISubscriberStream stream) {
super.streamSubscriberClose(stream);
String streamName = stream.getBroadcastStreamPublishName();
if(streamName.contains("/"))