mirror of
https://gitlab.xiph.org/xiph/ezstream.git
synced 2025-02-02 15:07:45 -05:00
Make relative path lookups configurable
Retain current behavior by default, where files are found based on the current working directory.
This commit is contained in:
parent
d59108b825
commit
06e49d2313
5
NEWS
5
NEWS
@ -1,10 +1,13 @@
|
|||||||
Changes in 1.NNN, released on YYYY-MM-DD:
|
Changes in 1.1.0, released on YYYY-MM-DD:
|
||||||
|
|
||||||
* Fix regression when streaming formats other than Ogg (e.g. MP3). From
|
* Fix regression when streaming formats other than Ogg (e.g. MP3). From
|
||||||
zygmund2000 on Github (#30) and Roland Hermans on GitLab (#2271).
|
zygmund2000 on Github (#30) and Roland Hermans on GitLab (#2271).
|
||||||
* Fix build issue on OSX. From Mitchell Blank on GitLab (#2270).
|
* Fix build issue on OSX. From Mitchell Blank on GitLab (#2270).
|
||||||
* Support reproducible builds. Via Unit 193 on GitLab (#2276).
|
* Support reproducible builds. Via Unit 193 on GitLab (#2276).
|
||||||
* Update autoconf requirement to 2.69
|
* Update autoconf requirement to 2.69
|
||||||
|
* Add <rel_to_list /> setting to look for files relative to the playlist
|
||||||
|
file location instead of the current working directory. From Dan Sanford
|
||||||
|
on GitLab (#2283).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ dnl ###########
|
|||||||
dnl ## SETUP ###########################################################
|
dnl ## SETUP ###########################################################
|
||||||
dnl ###########
|
dnl ###########
|
||||||
|
|
||||||
AC_INIT([ezstream], [1.0.2], [https://gitlab.xiph.org/xiph/ezstream/issues])
|
AC_INIT([ezstream], [1.1.0], [https://gitlab.xiph.org/xiph/ezstream/issues])
|
||||||
AC_PREREQ([2.69])
|
AC_PREREQ([2.69])
|
||||||
AC_CONFIG_SRCDIR([src/ezstream.c])
|
AC_CONFIG_SRCDIR([src/ezstream.c])
|
||||||
AC_CONFIG_AUX_DIR([build-aux])
|
AC_CONFIG_AUX_DIR([build-aux])
|
||||||
|
@ -498,6 +498,19 @@ default).
|
|||||||
.It Ar 1|Yes|True
|
.It Ar 1|Yes|True
|
||||||
After streaming all media input, exit.
|
After streaming all media input, exit.
|
||||||
.El
|
.El
|
||||||
|
.It Sy \&<rel_to_list\ /\&>
|
||||||
|
Boolean setting, whether to locate playlist entries
|
||||||
|
.Qq relative to the list .
|
||||||
|
Entries with absolute path names are not affected.
|
||||||
|
.Pp
|
||||||
|
.Bl -tag -width 0|NO|FALSE -compact
|
||||||
|
.It Ar 0|No|False
|
||||||
|
Find files relative to the current working directory of
|
||||||
|
.Nm
|
||||||
|
(the default).
|
||||||
|
.It Ar 1|Yes|True
|
||||||
|
Find files relative to the location of the playlist file or program.
|
||||||
|
.El
|
||||||
.El
|
.El
|
||||||
.Ss Metadata block
|
.Ss Metadata block
|
||||||
.Bl -tag -width -Ds
|
.Bl -tag -width -Ds
|
||||||
|
@ -143,11 +143,14 @@
|
|||||||
<!-- Input file, program name, or "stdin" keyword (deprecated) -->
|
<!-- Input file, program name, or "stdin" keyword (deprecated) -->
|
||||||
<filename>playlist.m3u</filename>
|
<filename>playlist.m3u</filename>
|
||||||
|
|
||||||
<!-- Setting to shuffle playlists -->
|
<!-- Shuffle playlists (default: no) -->
|
||||||
<shuffle>Yes</shuffle>
|
<shuffle>Yes</shuffle>
|
||||||
|
|
||||||
<!-- Setting whether to stream intake indefinitely or only once -->
|
<!-- Stream intake indefinitely or only once (default: no) -->
|
||||||
<stream_once>Yes</stream_once>
|
<stream_once>Yes</stream_once>
|
||||||
|
|
||||||
|
<!-- Search for files relative to the playlist location (default: no) -->
|
||||||
|
<rel_to_list>Yes</rel_to_list>
|
||||||
</intake>
|
</intake>
|
||||||
</intakes>
|
</intakes>
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@ struct cfg_intake {
|
|||||||
char filename[PATH_MAX];
|
char filename[PATH_MAX];
|
||||||
int shuffle;
|
int shuffle;
|
||||||
int stream_once;
|
int stream_once;
|
||||||
|
int rel_to_list;
|
||||||
};
|
};
|
||||||
|
|
||||||
TAILQ_HEAD(cfg_intake_list, cfg_intake);
|
TAILQ_HEAD(cfg_intake_list, cfg_intake);
|
||||||
@ -227,6 +228,15 @@ cfg_intake_set_stream_once(struct cfg_intake *i, struct cfg_intake_list *not_use
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
cfg_intake_set_rel_to_list(struct cfg_intake *i, struct cfg_intake_list *not_used,
|
||||||
|
const char *rel_to_list, const char **errstrp)
|
||||||
|
{
|
||||||
|
(void)not_used;
|
||||||
|
SET_BOOLEAN(i->rel_to_list, rel_to_list, errstrp);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
cfg_intake_validate(struct cfg_intake *i, const char **errstrp)
|
cfg_intake_validate(struct cfg_intake *i, const char **errstrp)
|
||||||
{
|
{
|
||||||
@ -287,3 +297,9 @@ cfg_intake_get_stream_once(struct cfg_intake *i)
|
|||||||
{
|
{
|
||||||
return (i->stream_once);
|
return (i->stream_once);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
cfg_intake_get_rel_to_list(struct cfg_intake *i)
|
||||||
|
{
|
||||||
|
return (i->rel_to_list);
|
||||||
|
}
|
||||||
|
@ -57,6 +57,8 @@ int cfg_intake_set_shuffle(cfg_intake_t, cfg_intake_list_t, const char *,
|
|||||||
const char **);
|
const char **);
|
||||||
int cfg_intake_set_stream_once(cfg_intake_t, cfg_intake_list_t,
|
int cfg_intake_set_stream_once(cfg_intake_t, cfg_intake_list_t,
|
||||||
const char *, const char **);
|
const char *, const char **);
|
||||||
|
int cfg_intake_set_rel_to_list(cfg_intake_t, cfg_intake_list_t,
|
||||||
|
const char *, const char **);
|
||||||
|
|
||||||
int cfg_intake_validate(cfg_intake_t, const char **);
|
int cfg_intake_validate(cfg_intake_t, const char **);
|
||||||
|
|
||||||
@ -70,5 +72,6 @@ const char *
|
|||||||
cfg_intake_get_filename(cfg_intake_t);
|
cfg_intake_get_filename(cfg_intake_t);
|
||||||
int cfg_intake_get_shuffle(cfg_intake_t);
|
int cfg_intake_get_shuffle(cfg_intake_t);
|
||||||
int cfg_intake_get_stream_once(cfg_intake_t);
|
int cfg_intake_get_stream_once(cfg_intake_t);
|
||||||
|
int cfg_intake_get_rel_to_list(cfg_intake_t);
|
||||||
|
|
||||||
#endif /* __CFG_INTAKE_H__ */
|
#endif /* __CFG_INTAKE_H__ */
|
||||||
|
@ -222,6 +222,7 @@ _cfgfile_xml_parse_intake(xmlDocPtr doc, xmlNodePtr cur)
|
|||||||
XML_INPUT_SET(i, il, cfg_intake_set_filename, "filename");
|
XML_INPUT_SET(i, il, cfg_intake_set_filename, "filename");
|
||||||
XML_INPUT_SET(i, il, cfg_intake_set_shuffle, "shuffle");
|
XML_INPUT_SET(i, il, cfg_intake_set_shuffle, "shuffle");
|
||||||
XML_INPUT_SET(i, il, cfg_intake_set_stream_once, "stream_once");
|
XML_INPUT_SET(i, il, cfg_intake_set_stream_once, "stream_once");
|
||||||
|
XML_INPUT_SET(i, il, cfg_intake_set_rel_to_list, "rel_to_list");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 > cfg_intake_validate(i, &errstr)) {
|
if (0 > cfg_intake_validate(i, &errstr)) {
|
||||||
@ -438,6 +439,7 @@ _cfgfile_xml_parse_encoders(xmlDocPtr doc, xmlNodePtr cur)
|
|||||||
* filename
|
* filename
|
||||||
* shuffle
|
* shuffle
|
||||||
* stream_once
|
* stream_once
|
||||||
|
* rel_to_list
|
||||||
* ...
|
* ...
|
||||||
* metadata
|
* metadata
|
||||||
* program
|
* program
|
||||||
@ -650,6 +652,8 @@ _cfgfile_xml_print_intake(cfg_intake_t i, void *arg)
|
|||||||
fprintf(fp, " <shuffle>yes</shuffle>\n");
|
fprintf(fp, " <shuffle>yes</shuffle>\n");
|
||||||
if (cfg_intake_get_stream_once(i))
|
if (cfg_intake_get_stream_once(i))
|
||||||
fprintf(fp, " <stream_once>yes</stream_once>\n");
|
fprintf(fp, " <stream_once>yes</stream_once>\n");
|
||||||
|
if (cfg_intake_get_rel_to_list(i))
|
||||||
|
fprintf(fp, " <rel_to_list>yes</rel_to_list>\n");
|
||||||
fprintf(fp, " </intake>\n");
|
fprintf(fp, " </intake>\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -684,7 +684,8 @@ streamPlaylist(stream_t stream)
|
|||||||
while ((song_next = playlist_get_next(playlist)) != NULL) {
|
while ((song_next = playlist_get_next(playlist)) != NULL) {
|
||||||
strlcpy(song_prev, song_next, sizeof(song_prev));
|
strlcpy(song_prev, song_next, sizeof(song_prev));
|
||||||
|
|
||||||
if ('/' == song_next[0])
|
if ('/' == song_next[0] ||
|
||||||
|
!cfg_intake_get_rel_to_list(cfg_intake))
|
||||||
(void)snprintf(tmp_path, sizeof(tmp_path), "%s",
|
(void)snprintf(tmp_path, sizeof(tmp_path), "%s",
|
||||||
song_next);
|
song_next);
|
||||||
else
|
else
|
||||||
|
@ -105,6 +105,13 @@ START_TEST(test_intake_set_stream_once)
|
|||||||
}
|
}
|
||||||
END_TEST
|
END_TEST
|
||||||
|
|
||||||
|
START_TEST(test_intake_set_rel_to_list)
|
||||||
|
{
|
||||||
|
TEST_BOOLEAN_T(cfg_intake_t, cfg_intake_list_get, intakes,
|
||||||
|
cfg_intake_set_rel_to_list, cfg_intake_get_rel_to_list);
|
||||||
|
}
|
||||||
|
END_TEST
|
||||||
|
|
||||||
START_TEST(test_intake_validate)
|
START_TEST(test_intake_validate)
|
||||||
{
|
{
|
||||||
cfg_intake_t in = cfg_intake_list_get(intakes, "test_intake_validate");
|
cfg_intake_t in = cfg_intake_list_get(intakes, "test_intake_validate");
|
||||||
@ -147,6 +154,7 @@ cfg_suite(void)
|
|||||||
tcase_add_test(tc_intake, test_intake_set_filename);
|
tcase_add_test(tc_intake, test_intake_set_filename);
|
||||||
tcase_add_test(tc_intake, test_intake_set_shuffle);
|
tcase_add_test(tc_intake, test_intake_set_shuffle);
|
||||||
tcase_add_test(tc_intake, test_intake_set_stream_once);
|
tcase_add_test(tc_intake, test_intake_set_stream_once);
|
||||||
|
tcase_add_test(tc_intake, test_intake_set_rel_to_list);
|
||||||
tcase_add_test(tc_intake, test_intake_validate);
|
tcase_add_test(tc_intake, test_intake_validate);
|
||||||
suite_add_tcase(s, tc_intake);
|
suite_add_tcase(s, tc_intake);
|
||||||
|
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
<filename></filename>
|
<filename></filename>
|
||||||
<shuffle></shuffle>
|
<shuffle></shuffle>
|
||||||
<stream_once></stream_once>
|
<stream_once></stream_once>
|
||||||
|
<rel_to_list></rel_to_list>
|
||||||
</intake>
|
</intake>
|
||||||
</intakes>
|
</intakes>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user