X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=write.c;h=125df1c1d94440f7cfabad1b56ef55f1ffaa4110;hp=512f8fcca23dce7e809ad19ed6c9784f45199993;hb=8c6ad492bee7eeec2bc667ce983c47f57fa45104;hpb=6105cde18ae21b82708a4c98aa2d54820afd47a5 diff --git a/write.c b/write.c index 512f8fcc..125df1c1 100644 --- a/write.c +++ b/write.c @@ -28,11 +28,11 @@ struct check_wav_task { char *buf; /** Number of bytes loaded in \a buf. */ size_t *loaded; - /** Non-zero if end of file was reached. */ - int *eof; + /** Non-zero if an error occurred or end of file was reached. */ + int *error; /** Number of channels specified in wav header given by \a buf. */ unsigned channels; - /** Samplerate specified in wav header given by \a buf. */ + /** Sample rate specified in wav header given by \a buf. */ unsigned samplerate; /** The task structure for this task. */ struct task task; @@ -59,7 +59,7 @@ static struct writer_node_group *wng; * Test if audio buffer contains a valid wave header. * * \return If not, return -E_NO_WAV_HEADER, otherwise, return zero. If - * there is less than WAV_HEADER_LEN bytes awailable, return one. + * there is less than WAV_HEADER_LEN bytes available, return one. */ static void check_wav_pre_select(__a_unused struct sched *s, struct task *t) { @@ -67,7 +67,7 @@ static void check_wav_pre_select(__a_unused struct sched *s, struct task *t) unsigned char *a; if (*wt->loaded < WAV_HEADER_LEN) { - t->ret = *wt->eof? -E_PREMATURE_END : 1; + t->ret = *wt->error? -E_PREMATURE_END : 1; return; } wt->channels = 2; @@ -170,7 +170,7 @@ static void idt_event_handler(struct task *t) unregister_task(t); wng->buf = sit.buf; wng->loaded = &sit.loaded; - wng->input_eof = &sit.eof; + wng->input_error = &sit.error; wng->task.event_handler = wng_event_handler; wng->channels = &cwt.channels; wng->samplerate = &cwt.samplerate; @@ -234,7 +234,7 @@ int main(int argc, char *argv[]) cwt.task.event_handler = cwt_event_handler; cwt.buf = sit.buf; cwt.loaded = &sit.loaded; - cwt.eof = &sit.eof; + cwt.error = &sit.error; sprintf(cwt.task.status, "check wav"); register_task(&cwt.task);