summaryrefslogtreecommitdiff
path: root/src/liana/handlers/codec_client.c
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2026-09-14 08:57:42 -0400
committerAndrew Opalach <andrew@akon.city> 2026-09-14 08:57:42 -0400
commit8f208c26b6fa1a9f3372679c047cab559c06e26b (patch)
tree323d894d6ff8e1ed1445c40cb1e2f5d3cee5e8e8 /src/liana/handlers/codec_client.c
parentc66c7c64ebd16287b892f8a780cffcabafba3799 (diff)
downloadcamu-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/handlers/codec_client.c')
-rw-r--r--src/liana/handlers/codec_client.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/liana/handlers/codec_client.c b/src/liana/handlers/codec_client.c
index 5c8e94d..f7bde35 100644
--- a/src/liana/handlers/codec_client.c
+++ b/src/liana/handlers/codec_client.c
@@ -92,7 +92,9 @@ static bool codec_client_handle_packet(struct lia_client_handler *handler, struc
case CAMU_NORMAL: {
if (codec->dec) {
if (packet->opaque) {
- success = push_packet(codec, (struct nn_buffer *)packet->opaque);
+ struct nn_buffer *buffer = (struct nn_buffer *)packet->opaque;
+ success = push_packet(codec, buffer);
+ packet->opaque = NULL;
} else {
struct nn_buffer buffer;
nn_packet_read_buffer(packet, &buffer);
@@ -126,10 +128,10 @@ static bool codec_client_handle_packet(struct lia_client_handler *handler, struc
struct camu_codec_stream *stream = codec->handler.stream;
AVRational time_base = stream->av.stream->time_base;
pkt->pts += av_rescale_q(stream->duration, AV_TIME_BASE_Q, time_base);
- // @TODO: Shift av_packet_free() to vcr. This leaks right now.
#else
av_packet_free_side_data(pkt);
av_packet_free(&pkt);
+ packet->opaque = NULL;
#endif
break;
}
@@ -141,12 +143,7 @@ static bool codec_client_handle_packet(struct lia_client_handler *handler, struc
// Restore packet rindex in case we reuse it.
packet->rindex = rindex;
- if (!success) {
- codec->handler.callback(codec->handler.userdata, LIANA_CLIENT_ERRORED, codec->handler.stream, NULL);
- return false;
- }
-
- return true;
+ return success;
}
static void codec_client_flush(struct lia_client_handler *handler)