Revision 7fce481a libavfilter/avfilter.c

View differences:

libavfilter/avfilter.c
45 45
#define link_dpad(link)     link->dst-> input_pads[link->dstpad]
46 46
#define link_spad(link)     link->src->output_pads[link->srcpad]
47 47

  
48
AVFilterBufferRef *avfilter_ref_pic(AVFilterBufferRef *ref, int pmask)
48
AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask)
49 49
{
50 50
    AVFilterBufferRef *ret = av_malloc(sizeof(AVFilterBufferRef));
51 51
    *ret = *ref;
52 52
    ret->perms &= pmask;
53
    ret->pic->refcount ++;
53
    ret->buf->refcount ++;
54 54
    return ret;
55 55
}
56 56

  
57
void avfilter_unref_pic(AVFilterBufferRef *ref)
57
void avfilter_unref_buffer(AVFilterBufferRef *ref)
58 58
{
59
    if(!(--ref->pic->refcount))
60
        ref->pic->free(ref->pic);
59
    if(!(--ref->buf->refcount))
60
        ref->buf->free(ref->buf);
61 61
    av_free(ref);
62 62
}
63 63

  
......
264 264

  
265 265
        link->cur_pic = avfilter_default_get_video_buffer(link, dst->min_perms, link->w, link->h);
266 266
        link->srcpic = picref;
267
        avfilter_copy_picref_props(link->cur_pic, link->srcpic);
267
        avfilter_copy_buffer_ref_props(link->cur_pic, link->srcpic);
268 268
    }
269 269
    else
270 270
        link->cur_pic = picref;
......
284 284
    /* unreference the source picture if we're feeding the destination filter
285 285
     * a copied version dues to permission issues */
286 286
    if(link->srcpic) {
287
        avfilter_unref_pic(link->srcpic);
287
        avfilter_unref_buffer(link->srcpic);
288 288
        link->srcpic = NULL;
289 289
    }
290 290

  

Also available in: Unified diff