From b0eda7b48c31a0bc9b474d5c08b79149a4ee330e Mon Sep 17 00:00:00 2001 From: Moritz Grimm Date: Tue, 2 Jun 2015 23:45:10 +0200 Subject: [PATCH] Add cfg_get_stream_format_str() --- src/cfg.c | 6 ++++++ src/cfg.h | 2 ++ tests/check_cfg.c | 2 ++ 3 files changed, 10 insertions(+) diff --git a/src/cfg.c b/src/cfg.c index a88b9be..91d0128 100644 --- a/src/cfg.c +++ b/src/cfg.c @@ -724,6 +724,12 @@ cfg_get_stream_format(void) return (cfg.stream.format); } +const char * +cfg_get_stream_format_str(void) +{ + return (cfg_stream_fmt2str(cfg.stream.format)); +} + const char * cfg_get_stream_encoder(void) { diff --git a/src/cfg.h b/src/cfg.h index 62b8982..8c03ca2 100644 --- a/src/cfg.h +++ b/src/cfg.h @@ -170,6 +170,8 @@ const char * int cfg_get_stream_server_public(void); enum cfg_stream_format cfg_get_stream_format(void); +const char * + cfg_get_stream_format_str(void); const char * cfg_get_stream_encoder(void); diff --git a/tests/check_cfg.c b/tests/check_cfg.c index c6762fd..b5dfd76 100644 --- a/tests/check_cfg.c +++ b/tests/check_cfg.c @@ -347,6 +347,8 @@ START_TEST(test_stream_format) ck_assert_int_eq(cfg_set_stream_format(CFG_SFMT_VORBIS, NULL), 0); ck_assert_int_eq(cfg_get_stream_format(), CFG_STREAM_VORBIS); + ck_assert_str_eq(cfg_get_stream_format_str(), + cfg_stream_fmt2str(CFG_STREAM_VORBIS)); } END_TEST