Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

Commit 2ba62ec

Browse files
author
Kuba Audykowicz
authored
Merge pull request #405 from DolbyIO/unknown_track_warning
Warn if the video track ID is suspicious
2 parents 486b234 + 1d25892 commit 2ba62ec

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

DolbyIO/Source/Private/Subsystem/DolbyIOVideoTracks.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,18 @@ UTexture2D* UDolbyIOSubsystem::GetTexture(const FString& VideoTrackID)
5050
void UDolbyIOSubsystem::BroadcastVideoTrackAdded(const FDolbyIOVideoTrack& VideoTrack)
5151
{
5252
DLB_UE_LOG("Video track added: TrackID=%s ParticipantID=%s", *VideoTrack.TrackID, *VideoTrack.ParticipantID);
53+
WarnIfVideoTrackSuspicious(VideoTrack.TrackID);
5354
BroadcastEvent(OnVideoTrackAdded, VideoTrack);
5455
}
5556

57+
void UDolbyIOSubsystem::WarnIfVideoTrackSuspicious(const FString& VideoTrackID)
58+
{
59+
if (VideoTrackID == "{-}")
60+
{
61+
DLB_UE_LOG_BASE(Warning, "Suspicious video track ID added, things may not work as expected");
62+
}
63+
}
64+
5665
void UDolbyIOSubsystem::BroadcastVideoTrackEnabled(const FDolbyIOVideoTrack& VideoTrack)
5766
{
5867
DLB_UE_LOG("Video track enabled: TrackID=%s ParticipantID=%s", *VideoTrack.TrackID, *VideoTrack.ParticipantID);
@@ -125,6 +134,7 @@ void UDolbyIOSubsystem::Handle(const remote_video_track_removed& Event)
125134
{
126135
const FDolbyIOVideoTrack VideoTrack = ToFDolbyIOVideoTrack(Event.track);
127136
DLB_UE_LOG("Video track removed: TrackID=%s ParticipantID=%s", *VideoTrack.TrackID, *VideoTrack.ParticipantID);
137+
WarnIfVideoTrackSuspicious(VideoTrack.TrackID);
128138

129139
FScopeLock Lock{&VideoSinksLock};
130140
if (std::shared_ptr<DolbyIO::FVideoSink>* Sink = VideoSinks.Find(VideoTrack.TrackID))

DolbyIO/Source/Public/DolbyIO.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ class DOLBYIO_API UDolbyIOSubsystem : public UGameInstanceSubsystem
438438
void BroadcastVideoTrackAdded(const FDolbyIOVideoTrack& VideoTrack);
439439
void BroadcastVideoTrackEnabled(const FDolbyIOVideoTrack& VideoTrack);
440440
void ProcessBufferedVideoTracks(const FString& ParticipantID);
441+
void WarnIfVideoTrackSuspicious(const FString& VideoTrackID);
441442

442443
void SetLocationUsingFirstPlayer();
443444
void SetLocalPlayerLocationImpl(const FVector& Location);

0 commit comments

Comments
 (0)