xbmc/xbmc — pull request #5370 by FernetMenta (2014-09-14 10:58:26+00:00)
Title: DXVA: fixes and rework

this is based on #5340 (to RMs shameless ping, this PRs need approval)

I reworked broken video surface handling for DXVA. A video surface is available for reuse when renderer has released it, not by some faulty age calculation.
Adapted DXVA to buffering in renderer. Renderer controls buffers, not the embedded processor. This give much better control.
When ffmpeg calls GetFormat and still has refs to the old decoder, ffmpeg buffers need to be flushed, otherwise it can crash.
Fix broken deinterlacing for DXVA-HD with more than 1 past references. @afedchin your were right with the order of past surfaces you had originally. Not sure if I had a faulty driver that time I changed it. Would be nice if you could review this PR.

@ace20022 could you please do some tests on this?

Note: 28c7d89 does not belong to this pr.