From 6d63f8e5d2f6d5db35cd5aa6bf5d2f069d3be2a7 Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Fri, 15 May 2026 02:28:11 +0300 Subject: [PATCH] janus: refactoring --- janus/src/rtpv.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/janus/src/rtpv.c b/janus/src/rtpv.c index 731847c..7f416a7 100644 --- a/janus/src/rtpv.c +++ b/janus/src/rtpv.c @@ -159,9 +159,13 @@ void _rtpv_process_nalu(us_rtpv_s *rtpv, const u8 *data, uz size, u32 pts, bool static sz _find_annexb(const u8 *data, uz size) { // Parses buffer for 00 00 01 start codes if (size >= _PRE) { - for (uz index = 0; index <= size - _PRE; ++index) { - if (data[index] == 0 && data[index + 1] == 0 && data[index + 2] == 1) { - return index; + for (uz i = 0; i <= size - _PRE; ++i) { + if ( + data[i] == 0 + && data[i + 1] == 0 + && data[i + 2] == 1 + ) { + return i; } } }