[vlc-devel] [PATCH] libvlc: media: remove flexible array member
Thomas Guillem
thomas at gllm.fr
Mon May 23 19:05:32 CEST 2016
From: Thomas Guillem <git at videolan.org>
Because ISO C++ has no notation of flexible arrays.
---
include/vlc/libvlc_media.h | 2 +-
lib/media.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/vlc/libvlc_media.h b/include/vlc/libvlc_media.h
index d05f642..d0aed42 100644
--- a/include/vlc/libvlc_media.h
+++ b/include/vlc/libvlc_media.h
@@ -286,9 +286,9 @@ typedef enum
*/
typedef struct
{
+ char * psz_uri;
libvlc_media_slave_type_t i_type;
unsigned int i_priority;
- char psz_uri[];
} libvlc_media_slave_t;
/**
diff --git a/lib/media.c b/lib/media.c
index 0b20aaa..74c9c3b 100644
--- a/lib/media.c
+++ b/lib/media.c
@@ -1189,6 +1189,7 @@ unsigned int libvlc_media_slaves_get( libvlc_media_t *p_md,
libvlc_media_slaves_release(pp_slaves, i);
return vlc_mutex_unlock( &p_input_item->lock ), 0;
}
+ p_slave->psz_uri = (char *) ((uint8_t *)p_slave) + sizeof(*p_slave);
strcpy( p_slave->psz_uri, p_item_slave->psz_uri );
switch( p_item_slave->i_type )
--
2.8.1
More information about the vlc-devel
mailing list