G_STMT_START { \
GstBuffer *buf = gst_buffer_new_and_alloc(num_bytes); \
GRand *rand = g_rand_new_with_seed (num_bytes); \
- guint8 *data; \
+ GstMapInfo info; \
guint i; \
- data = gst_buffer_map (buf, NULL, NULL, GST_MAP_WRITE); \
+ fail_unless (gst_buffer_map (buf, &info, GST_MAP_WRITE)); \
for (i = 0; i < num_bytes; ++i) \
- data[i] = (g_rand_int (rand) >> 24) & 0xff; \
- gst_buffer_unmap (buf, data, num_bytes); \
+ ((guint8 *)info.data)[i] = (g_rand_int (rand) >> 24) & 0xff; \
+ gst_buffer_unmap (buf, &info); \
fail_unless_equals_int (gst_pad_push (mysrcpad, buf), GST_FLOW_OK); \
g_rand_free (rand); \
} G_STMT_END