Commit 8d882cac authored by Moritz Grimm's avatar Moritz Grimm
Browse files

Switch to non-obsolete shout_set_content_format()

Error checking is now more strict; work around unreliability in tests
as failure/success depends on libshout configuration
parent 1517b7b5
......@@ -216,7 +216,7 @@ _stream_cfg_stream(struct stream *s, cfg_stream_t cfg_stream)
switch (cfg_stream_get_format(cfg_stream)) {
case CFG_STREAM_OGG:
if (SHOUTERR_SUCCESS !=
shout_set_format(s->shout, SHOUT_FORMAT_OGG)) {
shout_set_content_format(s->shout, SHOUT_FORMAT_OGG, 0, NULL)) {
log_error("stream: %s: format: %s: %s",
s->name, cfg_stream_get_format_str(cfg_stream),
shout_get_error(s->shout));
......@@ -225,7 +225,7 @@ _stream_cfg_stream(struct stream *s, cfg_stream_t cfg_stream)
break;
case CFG_STREAM_MP3:
if (SHOUTERR_SUCCESS !=
shout_set_format(s->shout, SHOUT_FORMAT_MP3)) {
shout_set_content_format(s->shout, SHOUT_FORMAT_MP3, 0, NULL)) {
log_error("stream: %s: format: %s: %s",
s->name, cfg_stream_get_format_str(cfg_stream),
shout_get_error(s->shout));
......@@ -234,7 +234,7 @@ _stream_cfg_stream(struct stream *s, cfg_stream_t cfg_stream)
break;
case CFG_STREAM_WEBM:
if (SHOUTERR_SUCCESS !=
shout_set_format(s->shout, SHOUT_FORMAT_WEBM)) {
shout_set_content_format(s->shout, SHOUT_FORMAT_WEBM, 0, NULL)) {
log_error("stream: %s: format: %s: %s",
s->name, cfg_stream_get_format_str(cfg_stream),
shout_get_error(s->shout));
......@@ -244,7 +244,7 @@ _stream_cfg_stream(struct stream *s, cfg_stream_t cfg_stream)
#ifdef SHOUT_FORMAT_MATROSKA
case CFG_STREAM_MATROSKA:
if (SHOUTERR_SUCCESS !=
shout_set_format(s->shout, SHOUT_FORMAT_MATROSKA)) {
shout_set_content_format(s->shout, SHOUT_FORMAT_MATROSKA, 0, NULL)) {
log_error("stream: %s: format: %s: %s",
s->name, cfg_stream_get_format_str(cfg_stream),
shout_get_error(s->shout));
......
......@@ -52,11 +52,18 @@ START_TEST(test_stream)
ck_assert_int_eq(cfg_stream_set_mountpoint(str_cfg, streams, "/test.ogg", NULL), 0);
ck_assert_int_ne(stream_configure(s), 0);
ck_assert_int_eq(cfg_stream_set_format(str_cfg, streams, "mp3", NULL), 0);
log_error("MP3 stream configuration result: %d (may be due to libshout config)",
stream_configure(s));
ck_assert_int_eq(cfg_stream_set_format(str_cfg, streams, "webm", NULL), 0);
log_error("WebM stream configuration result: %d (may be due to libshout config)",
stream_configure(s));
ck_assert_int_eq(cfg_stream_set_format(str_cfg, streams, "matroska", NULL), 0);
log_error("Matroska stream configuration result: %d (may be due to libshout config)",
stream_configure(s));
ck_assert_int_eq(cfg_stream_set_format(str_cfg, streams, "ogg", NULL), 0);
ck_assert_int_ne(stream_configure(s), 0);
cfg_intake_set_filename(int_cfg, intakes, "stream_test", NULL);
ck_assert_int_eq(stream_configure(s), 0);
ck_assert_int_eq(cfg_stream_set_format(str_cfg, streams, "ogg", NULL), 0);
ck_assert_int_eq(stream_configure(s), 0);
ck_assert_int_eq(cfg_stream_set_stream_name(str_cfg, streams, "test", NULL), 0);
ck_assert_int_eq(cfg_stream_set_stream_url(str_cfg, streams, "test", NULL), 0);
ck_assert_int_eq(cfg_stream_set_stream_genre(str_cfg, streams, "test", NULL), 0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment