Skip to content

Commit

Permalink
add error level to errors
Browse files Browse the repository at this point in the history
  • Loading branch information
odrling committed Jan 31, 2024
1 parent 41abc96 commit e844fb8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
29 changes: 20 additions & 9 deletions dakara_check.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,33 @@

enum dakara_stream_result {
OK,
UNHANDLED_STREAM,
UNKNOWN_STREAM,
LAVC_AAC_STREAM,
TOO_MANY_AUDIO_STREAMS,
TOO_MANY_VIDEO_STREAMS,
TOO_MANY_SUBTITLE_STREAMS,
ATTACHMENT_STREAM,
};

static char const *const dakara_results_error_reports[] = {
[OK] = "OK",
[UNHANDLED_STREAM] = "Unhandled stream type",
[LAVC_AAC_STREAM] = "Lavc/FFMPEG AAC stream",
[TOO_MANY_AUDIO_STREAMS] = "Too many audio streams",
[TOO_MANY_VIDEO_STREAMS] = "Too many video streams",
[TOO_MANY_SUBTITLE_STREAMS] = "Internal subtitle track should be removed",
[ATTACHMENT_STREAM] = "Attachment found (probably a font)",
enum dakara_check_error_level {
NONE,
WARNING,
ERROR,
};

struct dakara_check_report {
char const *const message;
enum dakara_check_error_level error_level;
};

static struct dakara_check_report dakara_results_error_reports[] = {
[OK] = {"OK", NONE},
[UNKNOWN_STREAM] = {"Unknown stream type", WARNING},
[LAVC_AAC_STREAM] = {"Lavc/FFMPEG AAC stream", ERROR},
[TOO_MANY_AUDIO_STREAMS] = {"Too many audio streams", ERROR},
[TOO_MANY_VIDEO_STREAMS] = {"Too many video streams", ERROR},
[TOO_MANY_SUBTITLE_STREAMS] = {"Internal subtitle track should be removed", ERROR},
[ATTACHMENT_STREAM] = {"Attachment found (probably a font)", ERROR},
};

struct dakara_check_results {
Expand Down
4 changes: 2 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project('dakara_check', 'c', version: '2.0.3')
project('dakara_check', 'c', version: '3.0.0')

git = find_program('git', required: false)

Expand All @@ -25,7 +25,7 @@ libdakara_check = library(
dependencies: deps,
install: true,
version: meson.project_version(),
soversion: '2',
soversion: '3',
)

dakara_check_exe = executable(
Expand Down

0 comments on commit e844fb8

Please sign in to comment.