summaryrefslogtreecommitdiff
path: root/src/codec
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2025-11-22 14:22:11 -0500
committerAndrew Opalach <andrew@akon.city> 2025-11-22 14:22:11 -0500
commit0d6d13425015d78606232874498327cabcb0e4e2 (patch)
tree34682f9e9602117dac6db5f7de8c67d1207135c4 /src/codec
parentd4ea79a8622b6bf03555f186aeb1f5fa9283721f (diff)
downloadcamu-0d6d13425015d78606232874498327cabcb0e4e2.tar.gz
camu-0d6d13425015d78606232874498327cabcb0e4e2.tar.bz2
camu-0d6d13425015d78606232874498327cabcb0e4e2.zip
Fixes and cleanup around synced gapless
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/codec')
-rw-r--r--src/codec/ffmpeg/packet_ext.c2
-rw-r--r--src/codec/stb_image.c8
2 files changed, 8 insertions, 2 deletions
diff --git a/src/codec/ffmpeg/packet_ext.c b/src/codec/ffmpeg/packet_ext.c
index 68f1b4c..6934cfe 100644
--- a/src/codec/ffmpeg/packet_ext.c
+++ b/src/codec/ffmpeg/packet_ext.c
@@ -122,7 +122,7 @@ void nn_packet_read_av_codec_parameters(struct nn_packet *packet, AVCodecParamet
u8 *extradata;
NNWT_PACKET_READ_DATA(packet, codecpar->extradata_size, extradata);
al_memcpy(codecpar->extradata, extradata, codecpar->extradata_size);
- NNWT_PACKET_READ_TYPE(packet, s32, codecpar->format);
+ NNWT_PACKET_READ_TYPE(packet, s32, codecpar->format);
NNWT_PACKET_READ_TYPE(packet, s64, codecpar->bit_rate);
NNWT_PACKET_READ_TYPE(packet, s32, codecpar->bits_per_coded_sample);
NNWT_PACKET_READ_TYPE(packet, s32, codecpar->bits_per_raw_sample);
diff --git a/src/codec/stb_image.c b/src/codec/stb_image.c
index 1d790dd..0cc61c8 100644
--- a/src/codec/stb_image.c
+++ b/src/codec/stb_image.c
@@ -1,3 +1,5 @@
+#define AL_LOG_SECTION "stb_image"
+#include <al/log.h>
#include "common.h"
#define STBI_MALLOC camu_page_alloc
#define STBI_FREE al_free
@@ -31,6 +33,7 @@ static bool stbi_demuxer_init(struct camu_demuxer *demux, struct cch_handle *han
s32 w, h, channels;
u8 *data = nn_buffer_get_ptr(&stb->buffer, 0);
if (!stbi_info_from_memory(data, stb->buffer.size, &w, &h, &channels)) {
+ log_error("stbi_info_from_memory() failed.");
return false;
}
@@ -123,7 +126,10 @@ static s32 stbi_decoder_push(struct camu_decoder *dec, struct camu_codec_packet
#else
u8 *pixels = stbi_load_from_memory(data, packet->buffer->size, &w, &h, &channels, 0);
#endif
- if (!pixels) return CAMU_ERR_ERROR;
+ if (!pixels) {
+ log_error("stbi_load_from_memory() failed.");
+ return CAMU_ERR_ERROR;
+ }
struct camu_video_format *fmt = &stb->stream->video.fmt;
al_assert(w > 0 && h > 0 && (u32)w == fmt->width && (u32)h == fmt->height);