/* Dump error on stderr with stream and error description, and return given
return_code */
-static int err(const char *msg, int snd_err, struct route_stream *s, int return_code)
+static int err(const char *msg, int snd_err, struct route_stream *s,
+ int return_code)
{
fprintf(logfile, "%s (%s): %s", s->id, s->pcm_name, msg);
if (snd_err < 0) {
return 0;
}
+ if (terminating) {
+ return ERR_TERMINATING;
+ }
+
/* EPIPE means overrun */
if (rc == -EPIPE) {
err("overrun occured", rc, s, ERR_READ_OVERRUN);
return 0;
}
+ if (terminating) {
+ return ERR_TERMINATING;
+ }
+
/* EPIPE means underrun */
if (rc == -EPIPE) {
err("underrun occured", rc, s, ERR_WRITE_UNDERRUN);