diff options
Diffstat (limited to 'src/codec/stb_image')
| -rw-r--r-- | src/codec/stb_image/impl.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/codec/stb_image/impl.c b/src/codec/stb_image/impl.c index 98d9e2c..ac1cbc5 100644 --- a/src/codec/stb_image/impl.c +++ b/src/codec/stb_image/impl.c @@ -40,9 +40,10 @@ static bool stbi_demuxer_init(struct camu_demuxer *demux, struct cch_handle *han struct camu_codec_stream stream = { 0 }; stream.mode = CAMU_NORMAL; stream.type = CAMU_STREAM_VIDEO; - stream.video.width = w; - stream.video.height = h; - stream.video.format = camu_pixel_format_from_channels(channels); + struct camu_video_format *fmt = &stream.video.fmt; + fmt->width = w; + fmt->height = h; + fmt->format = camu_pixel_format_from_channels(channels); al_array_push(stb->demux.streams, stream); @@ -106,7 +107,8 @@ static s32 stbi_decoder_push(struct camu_decoder *dec, struct camu_codec_packet u8 *data = aki_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; - al_assert(w == stb->stream->video.width && h == stb->stream->video.height); + struct camu_video_format *fmt = &stb->stream->video.fmt; + al_assert(w == fmt->width && h == fmt->height); struct camu_codec_frame *frame = al_alloc_object(struct camu_codec_frame); frame->mode = CAMU_NORMAL; @@ -115,7 +117,7 @@ static s32 stbi_decoder_push(struct camu_decoder *dec, struct camu_codec_packet frame->video.width = w; frame->video.height = h; frame->format = camu_pixel_format_from_channels(channels); - al_assert(frame->format == stb->stream->video.format); + al_assert(frame->format == fmt->format); frame->pts = 0.0; stb->callback(stb->userdata, frame); |