On Mon, Jun 12, 2017 at 11:39:30AM +0200, wm4 wrote:
> On Sat, 10 Jun 2017 23:44:32 +0200
> Hendrik Leppkes <[email protected]> wrote:
> 
> > On Sat, Jun 10, 2017 at 3:58 PM, Diego Biurrun <[email protected]> wrote:
> > > On Fri, Jun 09, 2017 at 04:27:35PM +0200, wm4 wrote:  
> > >> 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.  
> > >
> > > Constifying av_log() seems like the correct solution.
> > >  
> > >> --- a/libavcodec/dxva2.c
> > >> +++ b/libavcodec/dxva2.c
> > >> @@ -623,7 +622,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;
> > >>
> > >> @@ -759,7 +757,7 @@ int ff_dxva2_commit_buffer(AVCodecContext *avctx,
> > >>  #endif
> > >>      if (FAILED(hr)) {
> > >>          av_log(avctx, AV_LOG_ERROR, "Failed to get a buffer for %u: 
> > >> 0x%x\n",
> > >> -               type, hr);
> > >> +               type, (unsigned)hr);  
> > >
> > > This looks shady. What is the right length modifier for HRESULT? l?
> > >  
> > 
> > HRESULT is a signed long.
> > Microsoft CRTs actually have a special format specifier for HRESULTs,
> > %hr, which decode the number to its name, but I do not know how
> > widespread support for that is in mingw and the like.
> 
> I think it's better to just cast this to unsigned and use %x. Or a
> shared function that converts hresult to a string.

Why? This is Windows-specific code anyway, why not use existing Windows
system code then?

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to