aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-11-05 02:10:29 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-11-05 02:10:46 +0100
commit43fee7ad920d9b17f65c6ef0c7ef5353310a244d (patch)
treee6c1af281af2b59d9299f8b01b92aff1e8419a02 /libavcodec/utils.c
parent77f1199e8fd9a289ad64eb2bb5bd4deeda8bccb8 (diff)
parent4ff670d99bebd97429322719089363d83143477d (diff)
downloadffmpeg-43fee7ad920d9b17f65c6ef0c7ef5353310a244d.tar.gz
Merge commit '4ff670d99bebd97429322719089363d83143477d'
* commit '4ff670d99bebd97429322719089363d83143477d': hwaccel: Deinitialize hardware acceleration early enough Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 97e75c8782..5c7885ac07 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1210,6 +1210,11 @@ int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
memcpy(choices, fmt, (n + 1) * sizeof(*choices));
for (;;) {
+ if (avctx->hwaccel && avctx->hwaccel->uninit)
+ avctx->hwaccel->uninit(avctx);
+ av_freep(&avctx->internal->hwaccel_priv_data);
+ avctx->hwaccel = NULL;
+
ret = avctx->get_format(avctx, choices);
desc = av_pix_fmt_desc_get(ret);
@@ -1218,11 +1223,6 @@ int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
break;
}
- if (avctx->hwaccel && avctx->hwaccel->uninit)
- avctx->hwaccel->uninit(avctx);
- av_freep(&avctx->internal->hwaccel_priv_data);
- avctx->hwaccel = NULL;
-
if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL))
break;
if (avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)