diff options
Diffstat (limited to 'src/codec/ffmpeg')
| -rw-r--r-- | src/codec/ffmpeg/demuxer.c | 13 |
1 files changed, 7 insertions, 6 deletions
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; } |