From b99f2bfc3d74ed2e48f5118745971295130cdbe6 Mon Sep 17 00:00:00 2001 From: odrling Date: Sun, 4 Aug 2024 17:31:44 +0200 Subject: [PATCH] don't return dakara_check_results we use the struct given by the caller --- include/dakara_check.h | 9 ++++----- libdakara_check.c | 15 +++++---------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/include/dakara_check.h b/include/dakara_check.h index c72ec09..988981f 100644 --- a/include/dakara_check.h +++ b/include/dakara_check.h @@ -48,12 +48,11 @@ void dakara_check_results_init(dakara_check_results *res); const char *dakara_check_version(void); -dakara_check_results *dakara_check(char *filepath, dakara_check_results *res); +void dakara_check(char *filepath, dakara_check_results *res); -dakara_check_results *dakara_check_avio(size_t buffer_size, void *readable, - int (*read_packet)(void *, uint8_t *, int), - int64_t (*seek)(void *, int64_t, int), - dakara_check_results *res); +void dakara_check_avio(size_t buffer_size, void *readable, + int (*read_packet)(void *, uint8_t *, int), + int64_t (*seek)(void *, int64_t, int), dakara_check_results *res); void dakara_check_print_results(dakara_check_results *res, char *filepath); diff --git a/libdakara_check.c b/libdakara_check.c index 09a6408..d629101 100644 --- a/libdakara_check.c +++ b/libdakara_check.c @@ -95,7 +95,7 @@ static void dakara_check_avf(AVFormatContext *s, dakara_check_results *res) { ffaacsucks_result_free(ffaac_res); } -dakara_check_results *dakara_check(char *filepath, dakara_check_results *res) { +void dakara_check(char *filepath, dakara_check_results *res) { AVFormatContext *s = NULL; dakara_check_results_init(res); @@ -103,21 +103,18 @@ dakara_check_results *dakara_check(char *filepath, dakara_check_results *res) { if (ret < 0) { fprintf(stderr, "failed to load file %s: %s\n", filepath, strerror(errno)); res->report.errors.io_error = true; - return res; + return; } dakara_check_avf(s, res); avformat_close_input(&s); avformat_free_context(s); - - return res; } -dakara_check_results *dakara_check_avio(size_t buffer_size, void *readable, - int (*read_packet)(void *, uint8_t *, int), - int64_t (*seek)(void *, int64_t, int), - dakara_check_results *res) { +void dakara_check_avio(size_t buffer_size, void *readable, + int (*read_packet)(void *, uint8_t *, int), + int64_t (*seek)(void *, int64_t, int), dakara_check_results *res) { AVFormatContext *fmt_ctx = NULL; AVIOContext *avio_ctx = NULL; dakara_check_results_init(res); @@ -162,8 +159,6 @@ dakara_check_results *dakara_check_avio(size_t buffer_size, void *readable, av_freep(&avio_ctx->buffer); avio_context_free(&avio_ctx); } - - return res; } char const *dakara_check_str_report(union dakara_check_results_report *report) {