[gst-devel] alignment issues

Daniel Gazard daniel.gazard at free.fr
Wed Apr 7 03:49:03 CEST 2004

Ronald Bultje <rbultje at ronald.bitfreak.net> writes:

> On Fri, 2 Apr 2004, Daniel Gazard wrote:
>> I'm currently playing with gstreamer on an ARM9 based system and it
>> had exhibit several alignment issues in a few plugins. Here is the
>> typical peace of code which may cause problem (from
>> gst-plugins-0.8.0/gst/mpegstream/gstmpegpacketize.c:find_start_code):
>> code = GUINT32_FROM_BE (*((guint32 *) (buf)));
> [..]
>> May be there are other similar problems elsewhere. If someone is
>> interested, I can send my patches (I have to clean up the code
>> before).
> Please do. I sort-of dislike memcpy() though... Can you think of a quick
> macro to do this? E.g.:
> #define GST_READ_UINT32_BE(data) (data[0] << 24 | \
> 				  data[1] << 16 | \
> 				  data[2] <<  8 | \
> 				  data[3]         )
> (etc.)
> Same for uint64, 16, all also LE and maybe even several write macros. Such
> code should go somewhere in GStreamer core, I guess, since those are used
> virtually everywhere.

Here is patches (diff were made from the 0.8.0 version) that I use to fix
these alignment problems. You can find them at the following address:
You can do what you want with them... Each patch include a dedicated
entry in the ChangeLog file to see what was done.
I have tested them both on x86 and ARM but only by playing mp3, mpeg2
and mpeg4.

More information about the gstreamer-devel mailing list