diff options
author | Alberto Delmás <adelmas@gmail.com> | 2011-08-17 14:24:42 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-08-23 11:18:35 +0200 |
commit | 45ecda855405f102bcc5d8fbadc5f2376e8e9c42 (patch) | |
tree | e40dee592918dbe35b68dc943d15da93e294101c /libavcodec/mpegvideo.c | |
parent | 3be5a943514f4528056d91afb8347b3dc51f21d6 (diff) | |
download | ffmpeg-45ecda855405f102bcc5d8fbadc5f2376e8e9c42.tar.gz |
Windows Media Image decoder (WMVP/WVP2)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r-- | libavcodec/mpegvideo.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 365a0d4736..8d40492346 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -208,7 +208,12 @@ void ff_copy_picture(Picture *dst, Picture *src){ */ 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); } @@ -230,7 +235,10 @@ static int alloc_frame_buffer(MpegEncContext *s, Picture *pic) } } - 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", |