Module: libav
Branch: master
Commit: 644ce3e02f09e31e7db9c9547aef513bda0aa65f

Author:    wm4 <nfx...@googlemail.com>
Committer: Diego Biurrun <di...@biurrun.de>
Date:      Fri Jun  9 16:27:35 2017 +0200

dxva: fix some warnings

Some existed since forever, some are new.

The cast in get_surface() is silly, but unless we change the av_log
function signature, or all callers of ff_dxva2_get_surface_index(), it's
needed to remove the const warning.

Signed-off-by: Diego Biurrun <di...@biurrun.de>

---

 libavcodec/dxva2.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c
index e0c5406..d3df658 100644
--- a/libavcodec/dxva2.c
+++ b/libavcodec/dxva2.c
@@ -323,7 +323,6 @@ static int d3d11va_get_decoder_configuration(AVCodecContext 
*avctx,
                                              const D3D11_VIDEO_DECODER_DESC 
*desc,
                                              D3D11_VIDEO_DECODER_CONFIG 
*config)
 {
-    FFDXVASharedContext *sctx = DXVA_SHARED_CONTEXT(avctx);
     unsigned cfg_count = 0;
     D3D11_VIDEO_DECODER_CONFIG *cfg_list = NULL;
     HRESULT hr;
@@ -599,7 +598,6 @@ int ff_dxva2_decode_init(AVCodecContext *avctx)
     if (sctx->pix_fmt == AV_PIX_FMT_D3D11) {
         AVD3D11VADeviceContext *device_hwctx = frames_ctx->device_ctx->hwctx;
         AVD3D11VAContext *d3d11_ctx = &sctx->ctx.d3d11va;
-        HRESULT hr;
 
         ff_dxva2_lock(avctx);
         ret = d3d11va_create_decoder(avctx);
@@ -666,7 +664,7 @@ int ff_dxva2_decode_uninit(AVCodecContext *avctx)
     return 0;
 }
 
-static void *get_surface(AVCodecContext *avctx, const AVFrame *frame)
+static void *get_surface(const AVCodecContext *avctx, const AVFrame *frame)
 {
 #if CONFIG_D3D11VA
     if (frame->format == AV_PIX_FMT_D3D11) {
@@ -734,7 +732,7 @@ int ff_dxva2_commit_buffer(AVCodecContext *avctx,
                                             &dxva_data, &dxva_size);
 #endif
     if (FAILED(hr)) {
-        av_log(avctx, AV_LOG_ERROR, "Failed to get a buffer for %u: 0x%x\n",
+        av_log(avctx, AV_LOG_ERROR, "Failed to get a buffer for %u: %hr\n",
                type, hr);
         return -1;
     }
@@ -776,8 +774,7 @@ int ff_dxva2_commit_buffer(AVCodecContext *avctx,
 #endif
     if (FAILED(hr)) {
         av_log(avctx, AV_LOG_ERROR,
-               "Failed to release buffer type %u: 0x%x\n",
-               type, hr);
+               "Failed to release buffer type %u: %hr\n", type, hr);
         result = -1;
     }
     return result;
@@ -847,7 +844,7 @@ int ff_dxva2_common_end_frame(AVCodecContext *avctx, 
AVFrame *frame,
     } while(1);
 
     if (FAILED(hr)) {
-        av_log(avctx, AV_LOG_ERROR, "Failed to begin frame: 0x%x\n", hr);
+        av_log(avctx, AV_LOG_ERROR, "Failed to begin frame: %hr\n", hr);
         ff_dxva2_unlock(avctx);
         return -1;
     }
@@ -942,7 +939,7 @@ int ff_dxva2_common_end_frame(AVCodecContext *avctx, 
AVFrame *frame,
     }
 #endif
     if (FAILED(hr)) {
-        av_log(avctx, AV_LOG_ERROR, "Failed to execute: 0x%x\n", hr);
+        av_log(avctx, AV_LOG_ERROR, "Failed to execute: %hr\n", hr);
         result = -1;
     }
 
@@ -957,7 +954,7 @@ end:
 #endif
     ff_dxva2_unlock(avctx);
     if (FAILED(hr)) {
-        av_log(avctx, AV_LOG_ERROR, "Failed to end frame: 0x%x\n", hr);
+        av_log(avctx, AV_LOG_ERROR, "Failed to end frame: %hr\n", hr);
         result = -1;
     }
 

_______________________________________________
libav-commits mailing list
libav-commits@libav.org
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to