X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=flacdec_filter.c;h=621d50d2f97087404f15c1ae74d423d5ad4bae35;hb=464648bb2c7d75586dfee44917ca731e491ae01e;hp=e8baa6b4b35031205f4fb28d858a6c1593e7ae7e;hpb=01a7db579a518a1a03b940a5a42411e49123ac1b;p=paraslash.git diff --git a/flacdec_filter.c b/flacdec_filter.c index e8baa6b4..621d50d2 100644 --- a/flacdec_filter.c +++ b/flacdec_filter.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2012 Andre Noll + * Copyright (C) 2011-2013 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -25,7 +25,7 @@ struct private_flacdec_data { * We can not consume directly what was copied by the read callback * because we might need to feed unconsumend bytes to the decoder again * after the read callback ran out of data and returned ABORT. So we - * track how many bytes are unconsumed so far. + * track how many bytes have been fed to libflac but are unconsumed so far. */ size_t unconsumed; }; @@ -216,7 +216,7 @@ static void flacdec_pre_select(struct sched *s, struct task *t) return sched_min_delay(s); } -static void flacdec_post_select(__a_unused struct sched *s, struct task *t) +static int flacdec_post_select(__a_unused struct sched *s, struct task *t) { struct filter_node *fn = container_of(t, struct filter_node, task); struct private_flacdec_data *pfd = fn->private_data; @@ -224,7 +224,7 @@ static void flacdec_post_select(__a_unused struct sched *s, struct task *t) int ret; if (output_queue_full(btrn)) - return; + return 0; ret = btr_node_status(btrn, fn->min_iqs, BTR_NT_INTERNAL); if (ret < 0 && ret != -E_BTR_EOF) /* fatal error */ goto out; @@ -255,9 +255,9 @@ static void flacdec_post_select(__a_unused struct sched *s, struct task *t) fn->min_iqs = 0; ret = 1; out: - t->error = ret; if (ret < 0) - btr_remove_node(btrn); + btr_remove_node(&fn->btrn); + return ret; } static void flacdec_close(struct filter_node *fn)