Skip to content

Commit ddf4448

Browse files
committed
Send the frame number in the encrypted video header
1 parent bc78a82 commit ddf4448

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/stream.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ namespace stream {
128128
}
129129

130130
std::uint8_t iv[12]; // 12-byte IV is ideal for AES-GCM
131-
std::uint32_t unused;
131+
std::uint32_t frameNumber;
132132
std::uint8_t tag[16];
133133
};
134134

@@ -1419,7 +1419,7 @@ namespace stream {
14191419

14201420
// Encrypt the target buffer in place
14211421
auto *prefix = (video_packet_enc_prefix_t *) shards.prefix(x);
1422-
prefix->unused = 0;
1422+
prefix->frameNumber = packet->frame_index();
14231423
std::copy(std::begin(iv), std::end(iv), prefix->iv);
14241424
session->video.cipher->encrypt(std::string_view { (char *) inspect, (size_t) blocksize }, prefix->tag, &iv);
14251425
}

0 commit comments

Comments
 (0)