X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=write.c;h=b3824a081f594dee23617502caf65261717d77b9;hp=8411003027e33ad3a9bcc43962efcf65547dea04;hb=e4db7671a91a7552c642acc979f0eb278f8d467f;hpb=f3b4f3298d2dffdb84a121b7d4aa561975f79be9 diff --git a/write.c b/write.c index 84110030..b3824a08 100644 --- a/write.c +++ b/write.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2010 Andre Noll + * Copyright (C) 2005-2011 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -37,8 +37,9 @@ struct check_wav_task { int state; /** Number of channels. */ unsigned channels; - unsigned sample_rate; unsigned sample_format; + /** Sample rate specified in wav header given by \a buf. */ + unsigned sample_rate; /** The task structure used by the scheduler. */ struct task task; struct btr_node *btrn; @@ -208,6 +209,20 @@ static int main_btr(struct sched *s) s->default_timeout.tv_sec = 10; s->default_timeout.tv_usec = 50000; ret = schedule(s); + if (ret >= 0) { + int j; + for (j = 0; j < i; j++) { + struct task *t = &wns[j].task; + assert(t->error < 0); + if (t->error != -E_WRITE_COMMON_EOF + && t->error != -E_BTR_EOF) { + PARA_ERROR_LOG("%s: %s\n", t->status, + para_strerror(-t->error)); + if (ret >= 0) + ret = t->error; + } + } + } out: for (i--; i >= 0; i--) { struct writer_node *wn = wns + i; @@ -215,6 +230,7 @@ out: w->close(wn); btr_free_node(wn->btrn); + w->free_config(wn->conf); free(wn->conf); } free(wns);