This instructs the ->execute handler of the check_wav task to ask its
parent nodes for the channel count, sample rate and sample format in
case no wav header was found and no value for the query was given at
the command line. Currently this can never succeed, since the only
parent node of the check_wav task is the stdin task, which has no
clue about these things. However, once check_wav is being used by
the resample filter, one parent might be a decoder which can tell.
This requires to add the new public btr_parent() to buffer_tree.c to
let the check_wav node obtain the node to start the search from.
{
*tv = btrn->start;
}
+
+struct btr_node *btr_parent(struct btr_node *btrn)
+{
+ return btrn->parent;
+}
void btr_get_node_start(struct btr_node *btrn, struct timeval *tv);
struct btr_node *btr_search_node(const char *name, struct btr_node *root);
void btr_drain(struct btr_node *btrn);
+struct btr_node *btr_parent(struct btr_node *btrn);
val = header_val;
break;
case CWS_NO_HEADER:
+ /*
+ * No wav header available and no value specified at
+ * the command line. Maybe one of our parent nodes
+ * knows.
+ */
+ if (btr_exec_up(btr_parent(cwc->btrn), cmd, result) >= 0)
+ return 1;
/* Use default value */
val = arg;
break;