Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwm4 <nfxjfg@googlemail.com>2017-06-06 19:51:08 +0300
committerwm4 <nfxjfg@googlemail.com>2017-06-27 19:05:02 +0300
commit865360ba633b09f1292d52ba6d07f16b6bcef6df (patch)
tree0847cfd92293d080e8b7c09c5b846915c67b73b3 /libavcodec/decode.c
parent3303511f33dcc1b708fc18072cd93bca62196676 (diff)
lavc: set avctx->hwaccel before init
So a hwaccel can access avctx->hwaccel in init for whatever reason. This is for the new d3d hwaccel API. We could create separate entrypoints for each of the 3 hwaccel types (dxva2, d3d11va, new d3d11va), but this seems nicer. Merges Libav commit bd747b9226414007f0207fa201976af7217e3b77. Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libavcodec/decode.c')
-rw-r--r--libavcodec/decode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index f7dea930ed..dccce01402 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1248,16 +1248,16 @@ static int setup_hwaccel(AVCodecContext *avctx,
return AVERROR(ENOMEM);
}
+ avctx->hwaccel = hwa;
if (hwa->init) {
ret = hwa->init(avctx);
if (ret < 0) {
av_freep(&avctx->internal->hwaccel_priv_data);
+ avctx->hwaccel = NULL;
return ret;
}
}
- avctx->hwaccel = hwa;
-
return 0;
}