[vlc-commits] dxva2: use AVFrame.opaque to store internal per-picture state directly

Rémi Denis-Courmont git at videolan.org
Wed Jul 24 22:42:52 CEST 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jul 24 23:21:00 2013 +0300| [515959913922fc234d0d814e0d0b115f9c293ee5] | committer: Rémi Denis-Courmont

dxva2: use AVFrame.opaque to store internal per-picture state directly

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=515959913922fc234d0d814e0d0b115f9c293ee5
---

 modules/codec/avcodec/dxva2.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
index 39539d5..2a1c7d0 100644
--- a/modules/codec/avcodec/dxva2.c
+++ b/modules/codec/avcodec/dxva2.c
@@ -468,19 +468,15 @@ static int Get(vlc_va_t *external, AVFrame *ff)
         if (i == 0 || i == 3)
             ff->data[i] = (void*)surface->d3d;/* Yummie */
     }
+    ff->opaque = surface;
     return VLC_SUCCESS;
 }
 static void Release(vlc_va_t *external, AVFrame *ff)
 {
-    vlc_va_dxva2_t *va = vlc_va_dxva2_Get(external);
-    LPDIRECT3DSURFACE9 d3d = (LPDIRECT3DSURFACE9)(uintptr_t)ff->data[3];
-
-    for (unsigned i = 0; i < va->surface_count; i++) {
-        vlc_va_surface_t *surface = &va->surface[i];
+    vlc_va_surface_t *surface = ff->opaque;
 
-        if (surface->d3d == d3d)
-            surface->refcount--;
-    }
+    surface->refcount--;
+    (void) external;
 }
 static void Close(vlc_va_t *external)
 {



More information about the vlc-commits mailing list