[vlc-devel] commit: vout: use the new var_GetAddress. ( Rémi Duraffort )
git version control
git at videolan.org
Sat Oct 10 11:57:45 CEST 2009
vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Mon Oct 5 10:47:54 2009 +0200| [1f9d1546025e57b8aac26c7d7e301f65f3df4091] | committer: Rémi Duraffort
vout: use the new var_GetAddress.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1f9d1546025e57b8aac26c7d7e301f65f3df4091
---
modules/video_output/drawable.c | 11 ++---------
modules/video_output/xcb/window.c | 11 +++--------
2 files changed, 5 insertions(+), 17 deletions(-)
diff --git a/modules/video_output/drawable.c b/modules/video_output/drawable.c
index bdca15b..34a64fd 100644
--- a/modules/video_output/drawable.c
+++ b/modules/video_output/drawable.c
@@ -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)
{
diff --git a/modules/video_output/xcb/window.c b/modules/video_output/xcb/window.c
index e6f93f9..9fe20df 100644
--- a/modules/video_output/xcb/window.c
+++ b/modules/video_output/xcb/window.c
@@ -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)
{
More information about the vlc-devel
mailing list