summaryrefslogtreecommitdiff
path: root/src/liana/handlers
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2025-02-19 13:40:38 -0500
committerAndrew Opalach <andrew@akon.city> 2025-02-19 13:40:38 -0500
commit2bee71a7e032c0972418e324bb1d7e6b02330b18 (patch)
treefa5819e9d9efe75cbc6f50d462dd0eb6bd19b6a2 /src/liana/handlers
parentb36f022defd8d4ec5a8c29578bb583bea05dfbb6 (diff)
downloadcamu-2bee71a7e032c0972418e324bb1d7e6b02330b18.tar.gz
camu-2bee71a7e032c0972418e324bb1d7e6b02330b18.tar.bz2
camu-2bee71a7e032c0972418e324bb1d7e6b02330b18.zip
Server resource unload, many tweaks and fixes
- Initial liana client preferences. - Hook up libplacebo dx11 backend. - Make usage of FFmpeg hardware decoding api make some sense. Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/liana/handlers')
-rw-r--r--src/liana/handlers/codec_client.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/liana/handlers/codec_client.c b/src/liana/handlers/codec_client.c
index 36e475e..8a86799 100644
--- a/src/liana/handlers/codec_client.c
+++ b/src/liana/handlers/codec_client.c
@@ -43,6 +43,13 @@ static bool push_av_packet(struct lia_codec_client *codec, AVPacket *pkt)
s32 ret = codec->dec->push_av_packet(codec->dec, pkt);
return ret == CAMU_OK;
}
+
+static void passthrough_subtitle(struct lia_codec_client *codec, AVPacket *pkt)
+{
+ struct camu_codec_packet packet = { .av.pkt = pkt };
+ struct camu_codec_stream *stream = codec->handler.stream;
+ codec->handler.callback(codec->handler.userdata, LIANA_CLIENT_SUBTITLE, stream, &packet);
+}
#endif
static bool push_packet(struct lia_codec_client *codec, struct nn_buffer *buffer)
@@ -109,15 +116,16 @@ static bool codec_client_handle_packet(struct lia_client_handler *handler, struc
nn_packet_read_av_packet(packet, pkt);
packet->opaque = pkt;
}
- struct camu_codec_stream *stream = codec->handler.stream;
if (codec->dec) {
success = push_av_packet(codec, pkt);
} else {
- codec->handler.callback(codec->handler.userdata, LIANA_CLIENT_SUBTITLE, stream, pkt);
+ passthrough_subtitle(codec, pkt);
success = true;
}
#ifdef VCR_BUFFER_WHOLE_FILE
- pkt->pts += av_rescale_q(stream->duration, AV_TIME_BASE_Q, stream->av.stream->time_base);
+ struct camu_codec_stream *stream = codec->handler.stream;
+ AVRational time_base = stream->av.stream->time;
+ pkt->pts += av_rescale_q(stream->duration, AV_TIME_BASE_Q, time_base);
#else
av_packet_unref(pkt);
av_packet_free(&pkt);