diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-21 16:01:59 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-21 16:02:13 +0100 |
commit | 91f4394ed31e8a5f6eec7071d38938d08b9300a6 (patch) | |
tree | 1996c8f31667caa293d7a70c7bcdf800469cb695 /libavcodec/dxva2.c | |
parent | 9056d0c94af5c09478acf0e1bc129a9c539070f0 (diff) | |
parent | 9d80b1ae9590a3d764b1b334fc2d1ef0097bcc1c (diff) | |
download | ffmpeg-91f4394ed31e8a5f6eec7071d38938d08b9300a6.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
dxva2: Log errors verbosely
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dxva2.c')
-rw-r--r-- | libavcodec/dxva2.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c index bc924222b3..401114e1c7 100644 --- a/libavcodec/dxva2.c +++ b/libavcodec/dxva2.c @@ -51,10 +51,13 @@ int ff_dxva2_commit_buffer(AVCodecContext *avctx, void *dxva_data; unsigned dxva_size; int result; + HRESULT hr; - if (FAILED(IDirectXVideoDecoder_GetBuffer(ctx->decoder, type, - &dxva_data, &dxva_size))) { - av_log(avctx, AV_LOG_ERROR, "Failed to get a buffer for %d\n", type); + hr = IDirectXVideoDecoder_GetBuffer(ctx->decoder, type, + &dxva_data, &dxva_size); + if (FAILED(hr)) { + av_log(avctx, AV_LOG_ERROR, "Failed to get a buffer for %d: 0x%x\n", + type, hr); return -1; } if (size <= dxva_size) { @@ -70,8 +73,12 @@ int ff_dxva2_commit_buffer(AVCodecContext *avctx, av_log(avctx, AV_LOG_ERROR, "Buffer for type %d was too small\n", type); result = -1; } - if (FAILED(IDirectXVideoDecoder_ReleaseBuffer(ctx->decoder, type))) { - av_log(avctx, AV_LOG_ERROR, "Failed to release buffer type %d\n", type); + + hr = IDirectXVideoDecoder_ReleaseBuffer(ctx->decoder, type); + if (FAILED(hr)) { + av_log(avctx, AV_LOG_ERROR, + "Failed to release buffer type %d: 0x%x\n", + type, hr); result = -1; } return result; @@ -143,14 +150,16 @@ int ff_dxva2_common_end_frame(AVCodecContext *avctx, Picture *pic, exec.NumCompBuffers = buffer_count; exec.pCompressedBuffers = buffer; exec.pExtensionData = NULL; - if (FAILED(IDirectXVideoDecoder_Execute(ctx->decoder, &exec))) { - av_log(avctx, AV_LOG_ERROR, "Failed to execute\n"); + hr = IDirectXVideoDecoder_Execute(ctx->decoder, &exec); + if (FAILED(hr)) { + av_log(avctx, AV_LOG_ERROR, "Failed to execute: 0x%x\n", hr); result = -1; } end: - if (FAILED(IDirectXVideoDecoder_EndFrame(ctx->decoder, NULL))) { - av_log(avctx, AV_LOG_ERROR, "Failed to end frame\n"); + hr = IDirectXVideoDecoder_EndFrame(ctx->decoder, NULL); + if (FAILED(hr)) { + av_log(avctx, AV_LOG_ERROR, "Failed to end frame: 0x%x\n", hr); result = -1; } |