Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Multiplexed stream is not present in OriginMapStore Redis db #1682

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/projects/publishers/ovt/ovt_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ bool OvtStream::Start()
return false;
}

if (GetLinkedInputStream() != nullptr && GetLinkedInputStream()->IsFromOriginMapStore() == false)
if (!IsFromOriginMapStore())
{
auto result = ocst::Orchestrator::GetInstance()->RegisterStreamToOriginMapStore(GetApplicationInfo().GetVHostAppName(), GetName());
if (result == CommonErrorCode::ERROR)
Expand Down Expand Up @@ -68,7 +68,7 @@ bool OvtStream::Stop()

logtd("OvtStream(%u) has been stopped", GetId());

if (GetLinkedInputStream() != nullptr && GetLinkedInputStream()->IsFromOriginMapStore() == false)
if (!IsFromOriginMapStore())
{
// Unegister stream if OriginMapStore is enabled
auto result = ocst::Orchestrator::GetInstance()->UnregisterStreamFromOriginMapStore(GetApplicationInfo().GetVHostAppName(), GetName());
Expand Down Expand Up @@ -263,4 +263,9 @@ bool OvtStream::RemoveSessionByConnectorId(int connector_id)
}

return false;
}

bool OvtStream::IsFromOriginMapStore() const
{
return GetLinkedInputStream() != nullptr && GetLinkedInputStream()->IsFromOriginMapStore();
}
2 changes: 2 additions & 0 deletions src/projects/publishers/ovt/ovt_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class OvtStream : public pub::Stream, public OvtPacketizerInterface

bool GenerateDescription();

bool IsFromOriginMapStore() const;

uint32_t _worker_count = 0;

Json::Value _description;
Expand Down