static void ReleaseBuffer(AVCodecContext *Context, AVFrame *Frame) { if (Frame->type == FF_BUFFER_TYPE_INTERNAL) { avcodec_default_release_buffer(Context, Frame); return; } VideoDecoder *parent = static_cast<VideoDecoder*>(Context->opaque); if (parent) parent->ReleaseAVBuffer(Context, Frame); else LOG(VB_GENERAL, LOG_ERR, "Invalid context"); }