Commit 1f9d1546 authored by Rémi Duraffort's avatar Rémi Duraffort

vout: use the new var_GetAddress.

parent 4632744f
...@@ -50,13 +50,6 @@ vlc_module_end () ...@@ -50,13 +50,6 @@ vlc_module_end ()
static int Control (vout_window_t *, int, va_list); static int Control (vout_window_t *, int, va_list);
/* TODO: move to vlc_variables.h */
static inline void *var_GetAddress (vlc_object_t *o, const char *name)
{
vlc_value_t val;
return var_Get (o, name, &val) ? NULL : val.p_address;
}
static vlc_mutex_t serializer = VLC_STATIC_MUTEX; static vlc_mutex_t serializer = VLC_STATIC_MUTEX;
/** /**
...@@ -79,7 +72,7 @@ static int Open (vlc_object_t *obj) ...@@ -79,7 +72,7 @@ static int Open (vlc_object_t *obj)
* more than one video track in the stream. */ * more than one video track in the stream. */
vlc_mutex_lock (&serializer); vlc_mutex_lock (&serializer);
/* TODO: per-type list of busy drawables */ /* TODO: per-type list of busy drawables */
used = var_GetAddress (VLC_OBJECT (obj->p_libvlc), "drawables-in-use"); used = var_GetAddress (obj->p_libvlc, "drawables-in-use");
if (used != NULL) if (used != NULL)
{ {
while (used[n] != NULL) while (used[n] != NULL)
...@@ -125,7 +118,7 @@ static void Close (vlc_object_t *obj) ...@@ -125,7 +118,7 @@ static void Close (vlc_object_t *obj)
/* Remove this drawable from the list of busy ones */ /* Remove this drawable from the list of busy ones */
vlc_mutex_lock (&serializer); vlc_mutex_lock (&serializer);
used = var_GetAddress (VLC_OBJECT (obj->p_libvlc), "hwnd-in-use"); used = var_GetAddress (obj->p_libvlc, "hwnd-in-use");
assert (used); assert (used);
while (used[n] != val) while (used[n] != val)
{ {
......
...@@ -497,7 +497,6 @@ static vlc_mutex_t serializer = VLC_STATIC_MUTEX; ...@@ -497,7 +497,6 @@ static vlc_mutex_t serializer = VLC_STATIC_MUTEX;
/** Acquire a drawable */ /** Acquire a drawable */
static int AcquireDrawable (vlc_object_t *obj, xcb_window_t window) static int AcquireDrawable (vlc_object_t *obj, xcb_window_t window)
{ {
vlc_value_t val;
xcb_window_t *used; xcb_window_t *used;
size_t n = 0; size_t n = 0;
...@@ -507,8 +506,7 @@ static int AcquireDrawable (vlc_object_t *obj, xcb_window_t window) ...@@ -507,8 +506,7 @@ static int AcquireDrawable (vlc_object_t *obj, xcb_window_t window)
/* Keep a list of busy drawables, so we don't overlap videos if there are /* Keep a list of busy drawables, so we don't overlap videos if there are
* more than one video track in the stream. */ * more than one video track in the stream. */
vlc_mutex_lock (&serializer); vlc_mutex_lock (&serializer);
var_Get (VLC_OBJECT (obj->p_libvlc), "xid-in-use", &val); used = var_GetAddress (obj->p_libvlc, "xid-in-use");
used = val.p_address;
if (used != NULL) if (used != NULL)
{ {
while (used[n]) while (used[n])
...@@ -524,8 +522,7 @@ static int AcquireDrawable (vlc_object_t *obj, xcb_window_t window) ...@@ -524,8 +522,7 @@ static int AcquireDrawable (vlc_object_t *obj, xcb_window_t window)
{ {
used[n] = window; used[n] = window;
used[n + 1] = 0; used[n + 1] = 0;
val.p_address = used; var_SetAddress (obj->p_libvlc, "xid-in-use", used);
var_Set (obj->p_libvlc, "xid-in-use", val);
} }
else else
{ {
...@@ -541,13 +538,11 @@ skip: ...@@ -541,13 +538,11 @@ skip:
/** Remove this drawable from the list of busy ones */ /** Remove this drawable from the list of busy ones */
static void ReleaseDrawable (vlc_object_t *obj, xcb_window_t window) static void ReleaseDrawable (vlc_object_t *obj, xcb_window_t window)
{ {
vlc_value_t val;
xcb_window_t *used; xcb_window_t *used;
size_t n = 0; size_t n = 0;
vlc_mutex_lock (&serializer); vlc_mutex_lock (&serializer);
var_Get (VLC_OBJECT (obj->p_libvlc), "xid-in-use", &val); used = var_GetAddress (obj->p_libvlc, "xid-in-use");
used = val.p_address;
assert (used); assert (used);
while (used[n] != window) while (used[n] != window)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment