Commit 1f9d1546 authored by ivoire's avatar ivoire

vout: use the new var_GetAddress.

parent 4632744f
......@@ -50,13 +50,6 @@ vlc_module_end ()
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;
/**
......@@ -79,7 +72,7 @@ static int Open (vlc_object_t *obj)
* more than one video track in the stream. */
vlc_mutex_lock (&serializer);
/* 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)
{
while (used[n] != NULL)
......@@ -125,7 +118,7 @@ static void Close (vlc_object_t *obj)
/* Remove this drawable from the list of busy ones */
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);
while (used[n] != val)
{
......
......@@ -497,7 +497,6 @@ static vlc_mutex_t serializer = VLC_STATIC_MUTEX;
/** Acquire a drawable */
static int AcquireDrawable (vlc_object_t *obj, xcb_window_t window)
{
vlc_value_t val;
xcb_window_t *used;
size_t n = 0;
......@@ -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
* more than one video track in the stream. */
vlc_mutex_lock (&serializer);
var_Get (VLC_OBJECT (obj->p_libvlc), "xid-in-use", &val);
used = val.p_address;
used = var_GetAddress (obj->p_libvlc, "xid-in-use");
if (used != NULL)
{
while (used[n])
......@@ -524,8 +522,7 @@ static int AcquireDrawable (vlc_object_t *obj, xcb_window_t window)
{
used[n] = window;
used[n + 1] = 0;
val.p_address = used;
var_Set (obj->p_libvlc, "xid-in-use", val);
var_SetAddress (obj->p_libvlc, "xid-in-use", used);
}
else
{
......@@ -541,13 +538,11 @@ skip:
/** Remove this drawable from the list of busy ones */
static void ReleaseDrawable (vlc_object_t *obj, xcb_window_t window)
{
vlc_value_t val;
xcb_window_t *used;
size_t n = 0;
vlc_mutex_lock (&serializer);
var_Get (VLC_OBJECT (obj->p_libvlc), "xid-in-use", &val);
used = val.p_address;
used = var_GetAddress (obj->p_libvlc, "xid-in-use");
assert (used);
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