[vlc-commits] vaapi: avoid usage of vlc_va_t * from the release callback
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:29:21 2013 +0300| [b08d2a72e19a59123197201fbe01d3ba35853111] | committer: Rémi Denis-Courmont
vaapi: avoid usage of vlc_va_t * from the release callback
This will simplify later commits.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b08d2a72e19a59123197201fbe01d3ba35853111
---
modules/codec/avcodec/vaapi.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/modules/codec/avcodec/vaapi.c b/modules/codec/avcodec/vaapi.c
index d014d7d..bf93720 100644
--- a/modules/codec/avcodec/vaapi.c
+++ b/modules/codec/avcodec/vaapi.c
@@ -62,7 +62,7 @@ typedef struct
VASurfaceID i_id;
int i_refcount;
unsigned int i_order;
-
+ vlc_mutex_t *p_lock;
} vlc_va_surface_t;
struct vlc_va_sys_t
@@ -284,6 +284,7 @@ static int CreateSurfaces( vlc_va_sys_t *sys, void **pp_hw_ctx, vlc_fourcc_t *pi
p_surface->i_id = pi_surface_id[i];
p_surface->i_refcount = 0;
p_surface->i_order = 0;
+ p_surface->p_lock = &sys->lock;
}
/* Create a context */
@@ -519,12 +520,11 @@ static int Get( vlc_va_t *va, AVFrame *p_ff )
static void Release( vlc_va_t *va, AVFrame *p_ff )
{
- vlc_va_sys_t *sys = va->sys;
vlc_va_surface_t *p_surface = p_ff->opaque;
- vlc_mutex_lock( &sys->lock );
+ vlc_mutex_lock( p_surface->p_lock );
p_surface->i_refcount--;
- vlc_mutex_unlock( &sys->lock );
+ vlc_mutex_unlock( p_surface->p_lock );
}
static void Close( vlc_va_sys_t *sys )
More information about the vlc-commits
mailing list