X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=alsa_write.c;h=535e7194c07f021e9958907effc5d8816333a8c7;hb=4ac3134c050ba28b57e0ae9686eb1f6d83e6d586;hp=e741578c66378d74926c28bea86a56c084bde255;hpb=ff70d3f74c6116cf5b3c9a6708218788363efa7c;p=paraslash.git diff --git a/alsa_write.c b/alsa_write.c index e741578c..535e7194 100644 --- a/alsa_write.c +++ b/alsa_write.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2011 Andre Noll + * Copyright (C) 2005-2012 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -16,7 +16,6 @@ #include #include #include -#include #include "para.h" #include "fd.h" @@ -114,6 +113,8 @@ static int alsa_init(struct private_alsa_write_data *pad, NULL); if (ret < 0 || buffer_time == 0) goto fail; + /* buffer at most 500 milliseconds */ + buffer_time = PARA_MIN(buffer_time, 500U * 1000U); msg = "could not set buffer time"; ret = snd_pcm_hw_params_set_buffer_time_near(pad->handle, hwparams, &buffer_time, NULL); @@ -323,7 +324,7 @@ again: ret = -E_ALSA; err: assert(ret < 0); - btr_remove_node(btrn); + btr_remove_node(&wn->btrn); t->error = ret; } @@ -357,7 +358,6 @@ void alsa_write_init(struct writer *w) w->pre_select = alsa_write_pre_select; w->post_select = alsa_write_post_select; w->parse_config_or_die = alsa_parse_config_or_die; - w->shutdown = NULL; /* nothing to do */ w->free_config = alsa_free_config; w->help = (struct ggo_help) { .short_help = alsa_write_args_info_help,