*/
static void free_frame_buffer(MpegEncContext *s, Picture *pic)
{
- ff_thread_release_buffer(s->avctx, (AVFrame*)pic);
+ /* Windows Media Image codecs allocate internal buffers with different
+ dimensions; ignore user defined callbacks for these */
+ if (s->codec_id != CODEC_ID_WMV3IMAGE && s->codec_id != CODEC_ID_VC1IMAGE)
+ ff_thread_release_buffer(s->avctx, (AVFrame*)pic);
+ else
+ avcodec_default_release_buffer(s->avctx, (AVFrame*)pic);
av_freep(&pic->f.hwaccel_picture_private);
}
}
}
- r = ff_thread_get_buffer(s->avctx, (AVFrame*)pic);
+ if (s->codec_id != CODEC_ID_WMV3IMAGE && s->codec_id != CODEC_ID_VC1IMAGE)
+ r = ff_thread_get_buffer(s->avctx, (AVFrame*)pic);
+ else
+ r = avcodec_default_get_buffer(s->avctx, (AVFrame*)pic);
if (r < 0 || !pic->f.age || !pic->f.type || !pic->f.data[0]) {
av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed (%d %d %d %p)\n",
s->dsp.draw_edges(s->current_picture_ptr->f.data[0] + y *s->linesize , s->linesize,
s->h_edge_pos , edge_h , EDGE_WIDTH , EDGE_WIDTH , sides);
s->dsp.draw_edges(s->current_picture_ptr->f.data[1] + (y>>vshift)*s->uvlinesize, s->uvlinesize,
- s->h_edge_pos>>hshift, edge_h>>hshift, EDGE_WIDTH>>hshift, EDGE_WIDTH>>vshift, sides);
+ s->h_edge_pos>>hshift, edge_h>>vshift, EDGE_WIDTH>>hshift, EDGE_WIDTH>>vshift, sides);
s->dsp.draw_edges(s->current_picture_ptr->f.data[2] + (y>>vshift)*s->uvlinesize, s->uvlinesize,
- s->h_edge_pos>>hshift, edge_h>>hshift, EDGE_WIDTH>>hshift, EDGE_WIDTH>>vshift, sides);
+ s->h_edge_pos>>hshift, edge_h>>vshift, EDGE_WIDTH>>hshift, EDGE_WIDTH>>vshift, sides);
}
h= FFMIN(h, s->avctx->height - y);