int32_t val;
if (bytes == 0) /* no data available */
return;
- ret = get_btr_sample_rate(btrn, &val);
- if (ret < 0)
- goto err;
+ get_btr_sample_rate(btrn, &val);
pad->sample_rate = val;
- ret = get_btr_channels(btrn, &val);
- if (ret < 0)
- goto err;
+ get_btr_channels(btrn, &val);
pad->channels = val;
PARA_INFO_LOG("%d channel(s), %dHz\n", pad->channels,
pad->sample_rate);
return;
if (powd->fd < 0) {
int32_t rate, ch;
- ret = get_btr_sample_rate(btrn, &rate);
- if (ret < 0)
- goto out;
- ret = get_btr_channels(btrn, &ch);
- if (ret < 0)
- goto out;
+ get_btr_sample_rate(btrn, &rate);
+ get_btr_channels(btrn, &ch);
ret = oss_init(wn, rate, ch);
if (ret < 0)
goto out;
if (AudioUnitInitialize(powd->audio_unit))
goto e1;
powd->play = 0;
- ret = get_btr_sample_rate(btrn, &val);
- if (ret < 0)
- goto e1;
+ get_btr_sample_rate(btrn, &val);
powd->sample_rate = val;
- ret = get_btr_channels(btrn, &val);
- if (ret < 0)
- goto e1;
+ get_btr_channels(btrn, &val);
powd->channels = val;
/*
* Choose PCM format. We tell the Output Unit what format we're going
}
}
-static int get_btr_value(struct btr_node *btrn, const char *key, int32_t *result)
+static void get_btr_value(struct btr_node *btrn, const char *cmd,
+ int32_t *result)
{
char *buf = NULL;
- int ret = btr_exec_up(btrn, key, &buf);
+ int ret = btr_exec_up(btrn, cmd, &buf);
- if (ret < 0)
- return ret;
+ assert(ret >= 0);
ret = para_atoi32(buf, result);
+ assert(ret >= 0);
free(buf);
- return ret;
}
/*
* Ask parent btr nodes for the sample rate of the current stream.
*/
-int get_btr_sample_rate(struct btr_node *btrn, int32_t *result)
+void get_btr_sample_rate(struct btr_node *btrn, int32_t *result)
{
- return get_btr_value(btrn, "sample_rate", result);
+ get_btr_value(btrn, "sample_rate", result);
}
/*
* Ask parent btr nodes for the channel count of the current stream.
*/
-int get_btr_channels(struct btr_node *btrn, int32_t *result)
+void get_btr_channels(struct btr_node *btrn, int32_t *result)
{
- return get_btr_value(btrn, "channels", result);
+ get_btr_value(btrn, "channels", result);
}
* Licensed under the GPL v2. For licencing details see COPYING.
*/
-/** \file write_common.h Exported symbols from write_common.c */
+/** \file write_common.h Exported symbols from write_common.c. */
void writer_init(void);
void *check_writer_arg(const char *wa, int *writer_num);
void register_writer_node(struct writer_node *wn, struct btr_node *parent);
int setup_writer_node(const char *arg, struct btr_node *parent,
struct writer_node *wn);
-int get_btr_sample_rate(struct btr_node *btrn, int32_t *result);
-int get_btr_channels(struct btr_node *btrn, int32_t *result);
+void get_btr_sample_rate(struct btr_node *btrn, int32_t *result);
+void get_btr_channels(struct btr_node *btrn, int32_t *result);