From cb342b234defc1205de5d8b10ddf79deae0a551a Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Sun, 11 May 2025 15:10:54 -0400 Subject: Add keybind to disable scaling filter - Fix no FFmpeg build. - Cleanup commented code from cmc ui. Signed-off-by: Andrew Opalach --- src/codec/codec.h | 3 ++- src/codec/ffmpeg/demuxer.c | 13 +++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'src/codec') diff --git a/src/codec/codec.h b/src/codec/codec.h index 48f83c7..14727d3 100644 --- a/src/codec/codec.h +++ b/src/codec/codec.h @@ -10,7 +10,8 @@ #include "../cache/handle.h" enum { - CAMU_LANG_ENGLISH = 0, + CAMU_LANG_UNKNOWN = 0, + CAMU_LANG_ENGLISH, CAMU_LANG_JAPANESE }; diff --git a/src/codec/ffmpeg/demuxer.c b/src/codec/ffmpeg/demuxer.c index b539577..bf2039f 100644 --- a/src/codec/ffmpeg/demuxer.c +++ b/src/codec/ffmpeg/demuxer.c @@ -5,8 +5,6 @@ #include "demuxer.h" #include "avio.h" -#define DEMUX_BUFFER_SIZE 4096 - static void close_internal(struct camu_ff_demuxer *av) { if (av->io_context) { @@ -30,8 +28,10 @@ static bool ff_demuxer_init(struct camu_demuxer *demux, struct cch_handle *handl goto err; } - u8 *buf = (u8 *)av_malloc(DEMUX_BUFFER_SIZE); - av->io_context = avio_alloc_context(buf, DEMUX_BUFFER_SIZE, 0, handle, camu_avio_read, NULL, camu_avio_seek); + // This is meant to be the "block size" so, if I understand correctly, that would mean + // the smallest amount for 1 read. Therefore, if reading from memory, it would be a page. + u8 *buf = (u8 *)av_malloc(al_page_size); + av->io_context = avio_alloc_context(buf, al_page_size, 0, handle, camu_avio_read, NULL, camu_avio_seek); if (!av->io_context) { log_error("Failed to create custom io context."); goto err; @@ -66,8 +66,9 @@ static bool ff_demuxer_init(struct camu_demuxer *demux, struct cch_handle *handl av_dict_free(&opts); - if (avformat_find_stream_info(av->format_context, NULL) < 0) { - log_error("Failed to find stream info."); + ret = avformat_find_stream_info(av->format_context, NULL); + if (ret < 0) { + log_error("Failed to find stream info (%s).", av_err2str(ret)); goto err; } -- cgit v1.2.3-101-g0448