diff options
author | jep <jep@2b0047a9-a6d8-0310-accf-f7200b2a168c> | 2012-07-04 11:44:26 +0000 |
---|---|---|
committer | jep <jep@2b0047a9-a6d8-0310-accf-f7200b2a168c> | 2012-07-04 11:44:26 +0000 |
commit | 4e08ae40caec6ee2d934a78a9a402a614ad34cd2 (patch) | |
tree | 8e51dac4818dd785cb12aa78f7861f64893a4abf /src | |
parent | 37ed007288293075f6c6f5f4fd7bee423e3279a9 (diff) |
* src/mp3tl-priv.h:
* src/mp3tl.c: (mp3tl_new), (mp3tl_free):
Ensure that the decoder instance is memory aligned otherwise
we can have some segfaults in the Neon assembly due missaligned
memory access.
git-svn-id: https://core.fluendo.com/gstreamer/svn/trunk/gst-fluendo-mp3@2324 2b0047a9-a6d8-0310-accf-f7200b2a168c
Diffstat (limited to 'src')
-rw-r--r-- | src/mp3tl-priv.h | 1 | ||||
-rw-r--r-- | src/mp3tl.c | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/mp3tl-priv.h b/src/mp3tl-priv.h index f5cfd97..37e280b 100644 --- a/src/mp3tl-priv.h +++ b/src/mp3tl-priv.h @@ -24,6 +24,7 @@ typedef float FRA[2][3][SBLIMIT]; struct mp3tl { + void * alloc_memory; gboolean need_sync; gboolean need_header; gboolean at_eos; diff --git a/src/mp3tl.c b/src/mp3tl.c index c77e9c9..8440738 100644 --- a/src/mp3tl.c +++ b/src/mp3tl.c @@ -28,13 +28,17 @@ mp3tl * mp3tl_new (Bit_stream_struc * bs, Mp3TlMode mode) { mp3tl *tl; + void *alloc_memory; g_return_val_if_fail (bs != NULL, NULL); g_return_val_if_fail (mode == MP3TL_MODE_16BIT, NULL); - tl = g_new0 (mp3tl, 1); + alloc_memory = g_malloc0 (sizeof (mp3tl) + __CACHE_LINE_BYTES); + + tl = (mp3tl *) __CACHE_LINE_ALIGN(alloc_memory); g_return_val_if_fail (tl != NULL, NULL); + tl->alloc_memory = alloc_memory; tl->bs = bs; tl->need_sync = TRUE; tl->need_header = TRUE; @@ -76,7 +80,7 @@ mp3tl_free (mp3tl * tl) mp3_ipp_close (tl); #endif - g_free (tl); + g_free (tl->alloc_memory); }; void |