On 9/18/13, Paul B Mahol <onemda@gmail.com> wrote:
On 9/18/13, Clement Boesch <u@pkh.me> wrote:
On Wed, Sep 18, 2013 at 06:34:36PM +0000, Paul B Mahol wrote:
Signed-off-by: Paul B Mahol <onemda@gmail.com> --- doc/filters.texi | 32 ++++++++++ libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/vf_qp.c | 154 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 188 insertions(+) create mode 100644 libavfilter/vf_qp.c
[...]
+static int filter_frame(AVFilterLink *inlink, AVFrame *in) +{ + AVFilterContext *ctx = inlink->dst; + AVFilterLink *outlink = ctx->outputs[0]; + QPContext *s = ctx->priv; + AVFrame *out; + + if (!s->qp_expr_str || ctx->is_disabled) + return ff_filter_frame(outlink, in); + + out = av_frame_clone(in); + if (!out) { + av_frame_free(&in); + return AVERROR(ENOMEM); + } +
+ out->qscale_table = s->qp;
So the table is valid for an undefined amount of time? With the ref counting API, I believe this is not the desired behaviour.
Right, silly me. I will copy it. Is there something else?
Or can I copy this? Nothing in codebase allocate this or free it so I'm not sure whatever I do is correct. As current mp=qp filter does nothing I will simply remove it. This may force someone(if any) who actually care about it to finnaly fix it. (He can reuse this template freely.)