From d271b5e9968c680a11048afe957d9191f435bef5 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 31 Aug 2017 18:48:24 +0200 Subject: [PATCH] profile: fix the wrong data/conf/profiles context --- data/conf/profiles | 4 ++-- src/profile.c | 3 ++- src/tvhlog.h | 5 +++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/data/conf/profiles b/data/conf/profiles index f57fd137a..54b1bb333 100644 --- a/data/conf/profiles +++ b/data/conf/profiles @@ -5,12 +5,12 @@ "name": "pass", "default": 1 }, - {, + { "comment": "Matroska", "class": "profile-matroska", "name": "matroska" }, - {, + { "comment": "HTSP Default Stream Settings", "class": "profile-htsp", "name": "htsp" diff --git a/src/profile.c b/src/profile.c index 0f7e53120..2fede2464 100644 --- a/src/profile.c +++ b/src/profile.c @@ -2510,7 +2510,8 @@ transcoder_create: /* Assign the default profile if config files are corrupted */ if (!profile_default) { pro = profile_find_by_name2("pass", NULL, 1); - assert(pro); + if (pro == NULL) + tvhabort(LS_PROFILE, "no default streaming profile! reinstall data files"); profile_default = pro; } } diff --git a/src/tvhlog.h b/src/tvhlog.h index 39774c6ec..3708ff17b 100644 --- a/src/tvhlog.h +++ b/src/tvhlog.h @@ -234,6 +234,11 @@ static inline void tvhtrace_no_warnings(const char *fmt, ...) { (void)fmt; } #define tvhnotice(...) tvhlog(LOG_NOTICE, ##__VA_ARGS__) #define tvherror(...) tvhlog(LOG_ERR, ##__VA_ARGS__) #define tvhalert(...) tvhlog(LOG_ALERT, ##__VA_ARGS__) +#define tvhabort(...) do { \ + tvhlog(LOG_ALERT, ##__VA_ARGS__); \ + tvh_safe_usleep(2000000); \ + abort(); \ +} while (0) void tvhlog_backtrace_printf(const char *fmt, ...); -- 2.47.3