summaryrefslogtreecommitdiff
path: root/src/codec/stb_image
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2025-02-04 21:05:18 -0500
committerAndrew Opalach <andrew@akon.city> 2025-02-04 21:05:18 -0500
commit0060d4f3df9b264e4a4adb77da67336709b41b6b (patch)
treea59d4e2f218cec89af56bdb2036d0a2ecd488349 /src/codec/stb_image
parentcdd1f574312722ab305cba6771d9bcc5da0b0c38 (diff)
downloadcamu-0060d4f3df9b264e4a4adb77da67336709b41b6b.tar.gz
camu-0060d4f3df9b264e4a4adb77da67336709b41b6b.tar.bz2
camu-0060d4f3df9b264e4a4adb77da67336709b41b6b.zip
Audio buffer and sink fixes, unsigned width/height
- Screen feature testing - Older FFmpeg support - Build configuration fixes Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/codec/stb_image')
-rw-r--r--src/codec/stb_image/client.c7
-rw-r--r--src/codec/stb_image/server.c4
2 files changed, 6 insertions, 5 deletions
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);