Exemplo n.º 1
0
void StreamReplicator::removeStreamReplica(StreamReplica* replicaBeingRemoved) {
    // First, handle the replica that's being removed the same way that we would if it were merely being deactivated:
    deactivateStreamReplica(replicaBeingRemoved);

    // Assert: fNumReplicas > 0
    if (fNumReplicas == 0) fprintf(stderr, "StreamReplicator::removeStreamReplica() Internal Error!\n"); // should not happen
    --fNumReplicas;

    // If this was the last replica, then delete ourselves (if we were set up to do so):
    if (fNumReplicas == 0 && fDeleteWhenLastReplicaDies) {
        Medium::close(this);
        return;
    }
}
Exemplo n.º 2
0
void StreamReplicator::removeStreamReplica(StreamReplica* replicaBeingRemoved) {
  // Assert: fNumReplicas > 0
  if (fNumReplicas == 0) fprintf(stderr, "StreamReplicator::removeStreamReplica() Internal Error!\n"); // should not happen
  --fNumReplicas;

  // If this was the last replica, then delete ourselves (if we were set up to do so):
  if (fNumReplicas == 0 && fDeleteWhenLastReplicaDies) {
    delete this;
    return;
  }

  // Now handle the replica that's being removed the same way that we would if it were merely being deactivated:
  if (replicaBeingRemoved->fFrameIndex != -1) { // i.e., we haven't already done this
    deactivateStreamReplica(replicaBeingRemoved);
  }
}