X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=alsa_write.c;h=53854e08c012dd7952df4d94ce50dae987dc004a;hp=88e48b4524717bc832201d7e5c5cac75976abffc;hb=dc26e5bc49d839fd966b7ad6f596e444ac8908d3;hpb=d46a0767b58654f15f16406cf99296287bd0d534 diff --git a/alsa_write.c b/alsa_write.c index 88e48b45..53854e08 100644 --- a/alsa_write.c +++ b/alsa_write.c @@ -34,16 +34,21 @@ struct private_alsa_write_data { snd_pcm_t *handle; /** Determined and set by alsa_init(). */ int bytes_per_frame; - /** - * The sample rate given by command line option or the decoder - * of the writer node group. + /* + * If the sample rate is not given at the command line and no wav + * header was detected, the btr exec mechanism is employed to query the + * ancestor buffer tree nodes for this information. In a typical setup + * the decoder passes the sample rate back to the alsa writer. + * + * \sa \ref btr_exec_up(). */ unsigned sample_rate; - snd_pcm_format_t sample_format; - /** - * The number of channels, given by command line option or the - * decoder of the writer node group. + /* + * The sample format (8/16 bit, signed/unsigned, little/big endian) is + * determined in the same way as the \a sample_rate. */ + snd_pcm_format_t sample_format; + /* The number of channels, again determined like \a sample_rate. */ unsigned channels; struct timeval drain_barrier; /* File descriptor for select(). */ @@ -211,7 +216,6 @@ static void alsa_write_pre_select(struct sched *s, struct task *t) if (ret < 0) { PARA_ERROR_LOG("could not get alsa poll fd: %s\n", snd_strerror(-ret)); - t->error = -E_ALSA; return; } pad->poll_fd = pfd.fd; @@ -361,9 +365,6 @@ void alsa_write_init(struct writer *w) w->post_select = alsa_write_post_select; w->parse_config_or_die = alsa_parse_config_or_die; w->free_config = alsa_free_config; - w->help = (struct ggo_help) { - .short_help = alsa_write_args_info_help, - .detailed_help = alsa_write_args_info_detailed_help - }; + w->help = (struct ggo_help)DEFINE_GGO_HELP(alsa_write); alsa_write_cmdline_parser_free(&dummy); }