mirror of https://github.com/OpenVidu/openvidu.git
recording: block on connect() before calling record()
The Kurento RecorderEndpoint.record() method expects that all elements have been successfully connected. However if connect() is called non- blocking, then it might happen that record() is called in parallel, when the connections haven't been done yet.pull/651/head
parent
3b3fcaa1f0
commit
1b01ffab81
|
@ -121,7 +121,11 @@ public class CompositeWrapper {
|
|||
|
||||
public void connectPublisherEndpoint(PublisherEndpoint endpoint) throws OpenViduException {
|
||||
HubPort hubPort = new HubPort.Builder(composite).build();
|
||||
endpoint.connect(hubPort, false);
|
||||
|
||||
// Block on this call: connections must have been already finished
|
||||
// before calling `RecorderEndpoint.record()`.
|
||||
endpoint.connect(hubPort, true);
|
||||
|
||||
String streamId = endpoint.getOwner().getPublisherStreamId();
|
||||
this.hubPorts.put(streamId, hubPort);
|
||||
this.publisherEndpoints.put(streamId, endpoint);
|
||||
|
@ -182,4 +186,4 @@ public class CompositeWrapper {
|
|||
return this.endTime - this.startTime;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue