Skip to content

Commit c9e4b52

Browse files
committed
block tags before first cluster, post tags after
1 parent 74b18b0 commit c9e4b52

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/client/src/Stream.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ STATUS putFrame(PKinesisVideoStream pKinesisVideoStream, PFrame pFrame)
731731
UINT64 remainingSize = 0, remainingDuration = 0, thresholdPercent = 0, duration = 0, viewByteSize = 0, allocSize = 0;
732732
PBYTE pAlloc = NULL;
733733
UINT32 trackIndex, packagedSize = 0, packagedMetadataSize = 0, overallSize = 0, itemFlags = ITEM_FLAG_NONE;
734-
BOOL streamLocked = FALSE, clientLocked = FALSE, freeOnError = TRUE;
734+
BOOL streamLocked = FALSE, clientLocked = FALSE, freeOnError = TRUE, justStartedStreaming = FALSE;
735735
EncodedFrameInfo encodedFrameInfo;
736736
MKV_STREAM_STATE generatorState = MKV_STATE_START_BLOCK;
737737
UINT64 currentTime = INVALID_TIMESTAMP_VALUE;
@@ -900,7 +900,7 @@ STATUS putFrame(PKinesisVideoStream pKinesisVideoStream, PFrame pFrame)
900900
CHK_STATUS(mkvgenPackageFrame(pKinesisVideoStream->pMkvGenerator, pFrame, pTrackInfo, pAlloc, &packagedSize, &encodedFrameInfo));
901901

902902
// Package the metadata if specified
903-
if (packagedMetadataSize != 0) {
903+
if (packagedMetadataSize != 0 && !justStartedStreaming) {
904904
// Move the packaged bits out first to make room for the metadata
905905
// NOTE: need to use MEMMOVE due to the overlapping ranges
906906
MEMMOVE(pAlloc + encodedFrameInfo.dataOffset + packagedMetadataSize, pAlloc + encodedFrameInfo.dataOffset,

0 commit comments

Comments
 (0)