mirror of
https://gitlab.xiph.org/xiph/ezstream.git
synced 2024-11-03 04:17:18 -05:00
The original reason to abort ezstream when running into problems opening a media
file was to prevent a very verbose infinite loop (e.g. when accidentially playing an outdated playlist.) Bring that back by aborting after 100 subsequent errors. git-svn-id: https://svn.xiph.org/trunk/ezstream@16527 0101bb08-14d6-0310-b084-bc0e0c8e3800
This commit is contained in:
parent
322b88412f
commit
995c5d2b77
2
NEWS
2
NEWS
@ -5,6 +5,8 @@ Changes in 0.5.6, released on XXXX-XX-XX:
|
||||
Failure to open a resource (e.g. a media file) is no longer fatal
|
||||
and operation will continue as far as possible. Idea from dhorton.
|
||||
(Ticket #1585)
|
||||
- [MISC] With the previous change, still abort ezstream after 100
|
||||
subsequent errors to prevent a very verbose infinite loop.
|
||||
* src/playlist.c:
|
||||
- [MISC] Consider no output from a playlist program to be equivalent to an
|
||||
empty line, indicating that the end of the playlist is reached.
|
||||
|
@ -57,6 +57,7 @@ int metadataFromProgram;
|
||||
EZCONFIG *pezConfig = NULL;
|
||||
playlist_t *playlist = NULL;
|
||||
int playlistMode = 0;
|
||||
unsigned int resource_errors = 0;
|
||||
|
||||
#ifdef HAVE_SIGNALS
|
||||
const int ezstream_signals[] = {
|
||||
@ -874,9 +875,15 @@ streamFile(shout_t *shout, const char *fileName)
|
||||
|
||||
if ((filepstream = openResource(shout, fileName, &popenFlag,
|
||||
&mdata, &isStdin, &songLen))
|
||||
== NULL)
|
||||
== NULL) {
|
||||
if (++resource_errors > 100) {
|
||||
printf("%s: Too many errors -- giving up.\n", __progname);
|
||||
return (0);
|
||||
}
|
||||
/* Continue with next resource on failure: */
|
||||
return (1);
|
||||
}
|
||||
resource_errors = 0;
|
||||
|
||||
if (mdata != NULL) {
|
||||
char *tmp, *metaData;
|
||||
|
Loading…
Reference in New Issue
Block a user