1
0
Fork 0

remove hold-last-look behaviors from receiver to universe

This commit is contained in:
Kevin Matz 2022-12-10 12:24:17 -05:00
parent 849da8cecb
commit 986dc9b89e
2 changed files with 16 additions and 14 deletions

View File

@ -126,19 +126,26 @@ std::shared_ptr<Universe> ArbitratingUniverse::addNewSource(const DATA::data_hea
*/
void ArbitratingUniverse::deleteSourceUniverse(const DATA::data_header& src)
{
{
std::shared_lock lk_ctl(mtx_control);
if (!hasSourceUniverse(src))
return;
if (sources_.size() == 1 && hold_last_look_)
return;
}
if (!hasSourceUniverse(src))
return;
if (sources_.size() > 1 || !hold_last_look_)
{
std::unique_lock lk_ctl(mtx_control);
sources_.erase(src);
}
else
{
std::shared_lock lk_ctl(mtx_control);
/// Set the universe's status to TERMINATED.
sources_.at(src)->setStatus(Universe::sACN_TERMINATED);
/// Resetting the sequencing on terminated universes results in faster reaquisition
/// from the same source without waiting for the sequence to realign.
sources_.at(src)->metadata()->sequence_number = 0;
}
doListChangeCallbacks();
doStatusCallbacks();
doStatusCallbacks(); // if the deleted universe was dominant, the status has changed
}

View File

@ -243,12 +243,7 @@ void Receiver::dataFrameHandler(ACN::PDU::Message<DATA::Pdu> frame)
/// > universe synchronization without waiting for a timeout to occur.
if (metadata->options.stream_terminated)
{
/// Set the universe's status to TERMINATED.
universe->setStatus(Universe::sACN_TERMINATED);
/// Resetting the sequencing on terminated universes results in faster reaquision
/// from the same source without waiting for the sequence to realign.
universe->metadata()->sequence_number = 0;
/// Terminated universe may be deleted as sources.
/// Remove the terminated universe as sources.
/// The universe may keep itself, in a terminated state, for hold-last-look.
universes_[metadata->universe]->deleteSourceUniverse(*metadata);
/// > Any property values in an E1.31 Data Packet containing this bit