diff options
author | Uoti Urpala <uau@mplayer2.org> | 2011-04-20 02:59:45 +0300 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2011-04-20 04:36:05 +0300 |
commit | c33fafd6f1bc2a430c114231cecc6e1c56c1f939 (patch) | |
tree | ffea28dc9b2845037a51cf3314b9b1f326fc1d2e /libmpcodecs/vd_ffmpeg.c | |
parent | 726c28dd9bbaf49d28d78f21fabd6d2d8336b9cd (diff) | |
download | mpv-c33fafd6f1bc2a430c114231cecc6e1c56c1f939.tar.bz2 mpv-c33fafd6f1bc2a430c114231cecc6e1c56c1f939.tar.xz |
Update libav API uses
Update various code to use newer alternatives instead of deprecated
functions/fields that are being dropped at libav API bump. An
exception is avcodec_thread_init() which is being dropped even though
it's still _necessary_ with fairly recent libav versions, so there's
no good alternative which would work with both those recent versions
and latest libavcodec. I think there are grounds to consider the drop
premature and revert it for now; if that doesn't happen I'll add a
version-test #if check around it later.
Diffstat (limited to 'libmpcodecs/vd_ffmpeg.c')
-rw-r--r-- | libmpcodecs/vd_ffmpeg.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index 2424dda95b..431b5cd340 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -208,7 +208,7 @@ static int init(sh_video_t *sh){ ctx->avctx = avcodec_alloc_context(); avctx = ctx->avctx; avctx->opaque = sh; - avctx->codec_type = CODEC_TYPE_VIDEO; + avctx->codec_type = AVMEDIA_TYPE_VIDEO; avctx->codec_id = lavc_codec->id; if (lavc_codec->capabilities & CODEC_CAP_HWACCEL // XvMC @@ -541,14 +541,12 @@ static int get_buffer(AVCodecContext *avctx, AVFrame *pic){ type = MP_IMGTYPE_STATIC; flags |= MP_IMGFLAG_PRESERVE; } - flags|=(!avctx->hurry_up && ctx->do_slices) ? - MP_IMGFLAG_DRAW_CALLBACK:0; + flags |= ctx->do_slices ? MP_IMGFLAG_DRAW_CALLBACK : 0; mp_msg(MSGT_DECVIDEO, MSGL_DBG2, type == MP_IMGTYPE_STATIC ? "using STATIC\n" : "using TEMP\n"); } else { if(!pic->reference){ ctx->b_count++; - flags|=(!avctx->hurry_up && ctx->do_slices) ? - MP_IMGFLAG_DRAW_CALLBACK:0; + flags |= ctx->do_slices ? MP_IMGFLAG_DRAW_CALLBACK:0; }else{ ctx->ip_count++; flags|= MP_IMGFLAG_PRESERVE|MP_IMGFLAG_READABLE @@ -787,7 +785,7 @@ static struct mp_image *decode(struct sh_video *sh, void *data, int len, pkt.data = data; pkt.size = len; // HACK: make PNGs decode normally instead of as CorePNG delta frames - pkt.flags = PKT_FLAG_KEY; + pkt.flags = AV_PKT_FLAG_KEY; // The avcodec opaque field stupidly supports only int64_t type *(double *)&avctx->reordered_opaque = *reordered_pts; ret = avcodec_decode_video2(avctx, pic, &got_picture, &pkt); |