Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
luzpaz
gstreamer
Commits
c8fc0574
Commit
c8fc0574
authored
Jun 02, 2011
by
Wim Taymans
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
memory: fix alignment calculations
Fix the alignment calculation. Improve documentation.
parent
d2d23074
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
gst/gstmemory.c
gst/gstmemory.c
+7
-2
No files found.
gst/gstmemory.c
View file @
c8fc0574
...
...
@@ -131,7 +131,7 @@ _default_mem_new_block (gsize maxsize, gsize align, gsize offset, gsize size)
data
=
(
guint8
*
)
mem
+
sizeof
(
GstMemoryDefault
);
if
((
aoffset
=
((
guintptr
)
data
&
align
)))
aoffset
=
align
-
aoffset
;
aoffset
=
(
align
+
1
)
-
aoffset
;
_default_mem_init
(
mem
,
0
,
NULL
,
slice_size
,
data
,
NULL
,
maxsize
+
align
,
aoffset
+
offset
,
size
);
...
...
@@ -405,9 +405,12 @@ gst_memory_new_wrapped (GstMemoryFlags flags, gpointer data,
* @maxsize: allocated size of @data
* @align: alignment for the data
*
* Allocate a new memory block with memory that is at least @maxsize big and
l
as
* Allocate a new memory block with memory that is at least @maxsize big and
h
as
* the given alignment.
*
* @align is given as a bitmask so that @align + 1 equals the amount of bytes to
* align to. For example, to align to 8 bytes, use an alignment of 7.
*
* Returns: a new #GstMemory.
*/
GstMemory
*
...
...
@@ -415,6 +418,8 @@ gst_memory_new_alloc (gsize maxsize, gsize align)
{
GstMemoryDefault
*
mem
;
g_return_val_if_fail
(((
align
+
1
)
&
align
)
==
0
,
NULL
);
mem
=
_default_mem_new_block
(
maxsize
,
align
,
0
,
maxsize
);
return
(
GstMemory
*
)
mem
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment