diff options
| author | 2026-09-14 08:57:42 -0400 | |
|---|---|---|
| committer | 2026-09-14 08:57:42 -0400 | |
| commit | 8f208c26b6fa1a9f3372679c047cab559c06e26b (patch) | |
| tree | 323d894d6ff8e1ed1445c40cb1e2f5d3cee5e8e8 /src/liana/common.h | |
| parent | c66c7c64ebd16287b892f8a780cffcabafba3799 (diff) | |
| download | camu-8f208c26b6fa1a9f3372679c047cab559c06e26b.tar.gz camu-8f208c26b6fa1a9f3372679c047cab559c06e26b.tar.bz2 camu-8f208c26b6fa1a9f3372679c047cab559c06e26b.zip | |
Server-side fixes from DIRECT_MODE testing
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/liana/common.h')
| -rw-r--r-- | src/liana/common.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/liana/common.h b/src/liana/common.h index 7776218..bdf4704 100644 --- a/src/liana/common.h +++ b/src/liana/common.h @@ -1,7 +1,35 @@ #pragma once +#include <nnwt/packet.h> + +#include "../server/common.h" +#include "../codec/codec.h" + #define LIANA_TIMESTAMP_INVALID ((u64)-1) #define LIANA_BASE_DELAY ((u64)1600000) // 1600ms #define LIANA_BASE_PING ((u64)600000) // 600ms #define LIANA_PAUSE_DELAY LIANA_BASE_PING + +static inline void disown_packet(struct nn_packet *packet) +{ +#ifdef CAMU_DIRECT_MODE + if (packet->opaque) { + switch (nn_packet_get_u8(packet, NNWT_PACKET_HEADER_LENGTH + 5)) { + case CAMU_NORMAL: + break; +#ifdef CAMU_HAVE_FFMPEG + case CAMU_FFMPEG_COMPAT: { + AVPacket *pkt = (AVPacket *)packet->opaque; + av_packet_free_side_data(pkt); + av_packet_free(&pkt); + break; + } +#endif + } + packet->opaque = NULL; + } +#else + (void)packet; +#endif +} |