You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
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 bd747b9226
.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
This commit is contained in:
@@ -1248,16 +1248,16 @@ static int setup_hwaccel(AVCodecContext *avctx,
|
|||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
avctx->hwaccel = hwa;
|
||||||
if (hwa->init) {
|
if (hwa->init) {
|
||||||
ret = hwa->init(avctx);
|
ret = hwa->init(avctx);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
av_freep(&avctx->internal->hwaccel_priv_data);
|
av_freep(&avctx->internal->hwaccel_priv_data);
|
||||||
|
avctx->hwaccel = NULL;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
avctx->hwaccel = hwa;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user