X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=flacdec_filter.c;h=fc382a798ddb0c9d0b0d416d65c447815aa15715;hp=01937e93f7fdbf2897e4404ffbb9e7781af392bd;hb=bc15c3ff65eb00e04ebc303cfa9ee3d1a4675b35;hpb=76a2c8cdd49d77ab9fa0db42b0a70428fdafd0a2 diff --git a/flacdec_filter.c b/flacdec_filter.c index 01937e93..fc382a79 100644 --- a/flacdec_filter.c +++ b/flacdec_filter.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2013 Andre Noll + * Copyright (C) 2011-2014 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -210,9 +210,9 @@ static bool output_queue_full(struct btr_node *btrn) return btr_get_output_queue_size(btrn) > FLACDEC_MAX_OUTPUT_SIZE; } -static void flacdec_pre_select(struct sched *s, struct task *t) +static void flacdec_pre_select(struct sched *s, void *context) { - struct filter_node *fn = container_of(t, struct filter_node, task); + struct filter_node *fn = context; struct private_flacdec_data *pfd = fn->private_data; struct btr_node *btrn = fn->btrn; int ret; @@ -226,9 +226,9 @@ static void flacdec_pre_select(struct sched *s, struct task *t) return sched_min_delay(s); } -static int flacdec_post_select(__a_unused struct sched *s, struct task *t) +static int flacdec_post_select(__a_unused struct sched *s, void *context) { - struct filter_node *fn = container_of(t, struct filter_node, task); + struct filter_node *fn = context; struct private_flacdec_data *pfd = fn->private_data; struct btr_node *btrn = fn->btrn; int ret; @@ -258,10 +258,12 @@ static int flacdec_post_select(__a_unused struct sched *s, struct task *t) goto out; if (state == FLAC__STREAM_DECODER_ABORTED) { FLAC__stream_decoder_flush(pfd->decoder); - fn->min_iqs = pfd->unconsumed + 1; + pfd->unconsumed = 0; /* feed unconsumed bytes again */ + fn->min_iqs = btr_get_input_queue_size(btrn) + 1; ret = 1; goto out; } + pfd->have_more = true; fn->min_iqs = 0; ret = 1; out: