summaryrefslogtreecommitdiff
path: root/src/codec
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2025-05-11 15:10:54 -0400
committerAndrew Opalach <andrew@akon.city> 2025-05-11 15:10:54 -0400
commitcb342b234defc1205de5d8b10ddf79deae0a551a (patch)
tree135a8f17ef297dcfa71cfa24de0170797add999e /src/codec
parentbbdc4ed66aa171f89f675aa1c82316477d5fd47e (diff)
downloadcamu-cb342b234defc1205de5d8b10ddf79deae0a551a.tar.gz
camu-cb342b234defc1205de5d8b10ddf79deae0a551a.tar.bz2
camu-cb342b234defc1205de5d8b10ddf79deae0a551a.zip
Add keybind to disable scaling filter
- Fix no FFmpeg build. - Cleanup commented code from cmc ui. Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/codec')
-rw-r--r--src/codec/codec.h3
-rw-r--r--src/codec/ffmpeg/demuxer.c13
2 files changed, 9 insertions, 7 deletions
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;
}