Commit 322b8841 authored by moritz's avatar moritz

... also fix ezstream in this regard: No need to complain when receiving such

an empty line, and not receiving any output should not be a fatal error.
Consider the latter to be "end-of-playlist", too.


git-svn-id: https://svn.xiph.org/trunk/ezstream@16526 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent c5da3377
......@@ -5,6 +5,11 @@ 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)
* 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.
- [FIX] Do not complain when receiving an empty line from a playlist
program.
* examples/:
- [NEW] Add a real-world example playlist script with logging feature.
......
......@@ -499,13 +499,18 @@ playlist_run_program(playlist_t *pl)
}
if (fgets(buf, (int)sizeof(buf), filep) == NULL) {
if (ferror(filep))
printf("%s: Error while reading output from program '%s': %s\n",
__progname, pl->filename, strerror(errno));
int errnum = errno;
pclose(filep);
printf("%s: FATAL: External program '%s' not (or no longer) usable.\n",
__progname, pl->filename);
exit(1);
if (ferror(filep)) {
printf("%s: Error while reading output from program '%s': %s\n",
__progname, pl->filename, strerror(errnum));
exit(1);
}
/* No output (end of playlist.) */
return (NULL);
}
pclose(filep);
......@@ -518,11 +523,9 @@ playlist_run_program(playlist_t *pl)
buf[strcspn(buf, "\n")] = '\0';
buf[strcspn(buf, "\r")] = '\0';
if (buf[0] == '\0') {
printf("%s: Empty line received from program '%s'\n",
__progname, pl->filename);
if (buf[0] == '\0')
/* Empty line (end of playlist.) */
return (NULL);
}
if (pl->prog_track != NULL)
xfree(pl->prog_track);
......
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