From 0060d4f3df9b264e4a4adb77da67336709b41b6b Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Tue, 4 Feb 2025 21:05:18 -0500 Subject: Audio buffer and sink fixes, unsigned width/height - Screen feature testing - Older FFmpeg support - Build configuration fixes Signed-off-by: Andrew Opalach --- src/codec/stb_image/client.c | 7 ++++--- src/codec/stb_image/server.c | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src/codec/stb_image') diff --git a/src/codec/stb_image/client.c b/src/codec/stb_image/client.c index 3742def..250876f 100644 --- a/src/codec/stb_image/client.c +++ b/src/codec/stb_image/client.c @@ -22,15 +22,16 @@ static s32 stbi_decoder_push(struct camu_decoder *dec, struct camu_codec_packet u8 *data = nn_buffer_get_ptr(packet->buffer, 0); u8 *pixels = stbi_load_from_memory(data, packet->buffer->size, &w, &h, &channels, 0); if (!pixels) return CAMU_ERR_ERROR; + struct camu_video_format *fmt = &stb->stream->video.fmt; - al_assert(w == fmt->width && h == fmt->height); + al_assert(w > 0 && h > 0 && (u32)w == fmt->width && (u32)h == fmt->height); struct camu_codec_frame *frame = al_alloc_object(struct camu_codec_frame); frame->mode = CAMU_NORMAL; frame->flags = 0; frame->data = pixels; - frame->video.width = w; - frame->video.height = h; + frame->video.width = (u32)w; + frame->video.height = (u32)h; frame->format = camu_pixel_format_from_channels(channels); al_assert(frame->format == fmt->format); frame->pts = 0.0; diff --git a/src/codec/stb_image/server.c b/src/codec/stb_image/server.c index 3642a64..79327d0 100644 --- a/src/codec/stb_image/server.c +++ b/src/codec/stb_image/server.c @@ -28,8 +28,8 @@ static bool stbi_demuxer_init(struct camu_demuxer *demux, struct cch_handle *han stream.mode = CAMU_NORMAL; stream.type = CAMU_STREAM_VIDEO; struct camu_video_format *fmt = &stream.video.fmt; - fmt->width = w; - fmt->height = h; + fmt->width = (u32)w; + fmt->height = (u32)h; fmt->format = camu_pixel_format_from_channels(channels); al_array_push(stb->demux.streams, stream); -- cgit v1.2.3-101-g0448