]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dxva2_h264.c
avcodec/cuvid: set width and height before calling get_format
[ffmpeg] / libavcodec / dxva2_h264.c
index 82a772d38ba4fffdca72ce819d5e69be04d198cd..59fa5e376921e45132a7cd5b2b7c6082350bfce1 100644 (file)
@@ -450,9 +450,7 @@ static int dxva2_h264_start_frame(AVCodecContext *avctx,
     AVDXVAContext *ctx = avctx->hwaccel_context;
     struct dxva2_picture_context *ctx_pic = h->cur_pic_ptr->hwaccel_picture_private;
 
-    if (DXVA_CONTEXT_DECODER(avctx, ctx) == NULL ||
-        DXVA_CONTEXT_CFG(avctx, ctx) == NULL ||
-        DXVA_CONTEXT_COUNT(avctx, ctx) <= 0)
+    if (!DXVA_CONTEXT_VALID(avctx, ctx))
         return -1;
     assert(ctx_pic);