#define MP3DEC_MAX_FRAME 8192
-static void mp3dec_post_select(__a_unused struct sched *s, struct task *t)
+static int mp3dec_post_select(__a_unused struct sched *s, struct task *t)
{
struct filter_node *fn = container_of(t, struct filter_node, task);
int i, ret;
next_buffer:
pmd->stream.error = 0;
- t->error = 0;
iqs = btr_get_input_queue_size(btrn);
ret = btr_node_status(btrn, fn->min_iqs, BTR_NT_INTERNAL);
if (ret < 0)
goto err;
if (ret == 0)
- return;
+ return 0;
btr_merge(btrn, fn->min_iqs);
len = btr_next_buffer(btrn, &inbuffer);
/*
}
if (loaded == 0)
goto next_buffer;
- return;
+ return 0;
}
pmd->sample_rate = pmd->frame.header.samplerate;
pmd->channels = MAD_NCHANNELS(&pmd->frame.header);
if (fn->min_iqs > MP3DEC_MAX_FRAME)
goto err;
mp3dec_consume(btrn, &pmd->stream, len);
- return;
+ return 0;
}
if (pmd->stream.error != MAD_ERROR_BADDATAPTR)
goto decode;
mp3dec_consume(btrn, &pmd->stream, len);
- return;
+ return 0;
}
fn->min_iqs = 0;
mad_synth_frame(&pmd->synth, &pmd->frame);
goto next_frame;
err:
assert(ret < 0);
- t->error = ret;
btr_remove_node(&fn->btrn);
+ return ret;
}
static void mp3dec_open(struct filter_node *fn)
f->parse_config = mp3dec_parse_config;
f->free_config = mp3dec_free_config;
f->pre_select = generic_filter_pre_select;
- f->post_select = mp3dec_post_select;
+ f->new_post_select = mp3dec_post_select;
+ f->post_select = NULL;
f->execute = mp3dec_execute;
f->help = (struct ggo_help) {
.short_help = mp3dec_filter_args_info_help,