From: Andre Noll Date: Sun, 28 Nov 2010 21:32:13 +0000 (+0100) Subject: write_common: Don't abort if btr_exec_up() failed. X-Git-Tag: v0.4.5~7 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=071538830bc5200f90b22576945687a2e43694a0;p=paraslash.git write_common: Don't abort if btr_exec_up() failed. btr_exec_up() failure is unusual but possible if the upper btr node dies just in the right moment. It happened for an aac file due to another bug in the fecdec filter (fixed in a subsequent patch) which caused the fecdec and hence the aacdec btr nodes to unregister themselves due to a full buffer tree pool. So replace the assertion by a fat error message. This sets the sample rate, channel count and the sample format to zero which makes the writer unregister itsself. This is better than aborting. --- diff --git a/write_common.c b/write_common.c index 93562d0d..7131a940 100644 --- a/write_common.c +++ b/write_common.c @@ -153,7 +153,15 @@ static void get_btr_value(struct btr_node *btrn, const char *cmd, char *buf = NULL; int ret = btr_exec_up(btrn, cmd, &buf); - assert(ret >= 0); + if (ret < 0) { + /* + * This really should not happen. It means one of our parent + * nodes died unexpectedly. Proceed with fingers crossed. + */ + PARA_CRIT_LOG("cmd %s: %s\n", cmd, para_strerror(-ret)); + *result = 0; + return; + } ret = para_atoi32(buf, result); assert(ret >= 0); free(buf);