fn->private_data = padd;
fn->bufsize = AAC_OUTBUF_SIZE;
fn->buf = para_calloc(fn->bufsize);
+ fn->min_iqs = 2048;
padd->handle = aac_open();
}
next_buffer:
t->error = 0;
- ret = prepare_filter_node(btrn, 2048);
+ ret = prepare_filter_node(btrn, fn->min_iqs);
if (ret < 0)
goto err;
if (ret == 0)
void *conf;
struct btr_node *btrn;
struct task task;
+ size_t min_iqs;
};
/** Describes one running instance of a chain of filters */
{
struct filter_node *fn = container_of(t, struct filter_node, task);
size_t iqs = btr_get_input_queue_size(fn->btrn);
- struct private_mp3dec_data *pmd = fn->private_data;
t->error = 0;
- if (iqs <= pmd->input_len_barrier)
+ if (iqs <= fn->min_iqs)
return;
if (btr_bytes_pending(fn->btrn) > MP3DEC_MAX_PENDING)
return; /* FIXME, should use reasonable bound on timeout */
iqs = btr_get_input_queue_size(btrn);
if (need_bad_data_delay(pmd, iqs))
return;
- ret = prepare_filter_node(btrn, pmd->input_len_barrier);
+ ret = prepare_filter_node(btrn, fn->min_iqs);
if (ret < 0)
goto err;
if (ret == 0)
ret = -E_MP3DEC_EOF;
goto err;
}
- pmd->input_len_barrier += 100;
+ fn->min_iqs += 100;
goto next_buffer;
} else if (pmd->stream.error != MAD_ERROR_LOSTSYNC)
PARA_DEBUG_LOG("header decode: %s\n",
mad_stream_errorstr(&pmd->stream));
goto next_buffer;
}
- pmd->input_len_barrier = 0;
+ fn->min_iqs = 0;
pmd->samplerate = pmd->frame.header.samplerate;
pmd->channels = MAD_NCHANNELS(&pmd->frame.header);
ret = mad_frame_decode(&pmd->frame, &pmd->stream);
unsigned int channels;
/** Current sample rate in Hz. */
unsigned int samplerate;
- size_t min_iqs;
};
static size_t cb_read_nobtr(void *buf, size_t size, size_t nmemb, void *datasource)
char *in;
t->error = 0;
- ret = prepare_filter_node(btrn, pod->min_iqs);
+ ret = prepare_filter_node(btrn, fn->min_iqs);
if (ret < 0)
goto err;
if (ret == 0)
if (!btr_no_parent(btrn)) {
free(pod->vf);
pod->vf = NULL;
- pod->min_iqs = iqs + 1;
+ fn->min_iqs = iqs + 1;
return;
}
ret = (oret == OV_ENOTVORBIS)?
int ret, converted = 0;
struct private_wmadec_data *pwd = fn->private_data;
struct btr_node *btrn = fn->btrn;
- size_t len, min_len;
+ size_t len;
char *in;
- min_len = pwd? WMA_FRAME_SKIP + pwd->ahi.block_align : 8192;
next_buffer:
t->error = 0;
- ret = prepare_filter_node(btrn, min_len);
+ ret = prepare_filter_node(btrn, fn->min_iqs);
if (ret < 0)
goto err;
if (ret == 0)
return;
len = btr_next_buffer(btrn, (char **)&in);
ret = -E_WMADEC_EOF;
- if (len < min_len)
+ if (len < fn->min_iqs)
goto err;
if (!pwd) {
ret = wma_decode_init(in, len, &pwd);
if (ret < 0)
goto err;
if (ret == 0) {
- min_len += 4096;
+ fn->min_iqs += 4096;
goto next_buffer;
}
+ fn->min_iqs = WMA_FRAME_SKIP + pwd->ahi.block_align;
fn->private_data = pwd;
converted = pwd->ahi.header_len;
goto success;
fn->buf = para_malloc(fn->bufsize);
fn->private_data = NULL;
fn->loaded = 0;
+ fn->min_iqs = 4096;
}
/**