[gst-devel] alignment issues
Ronald S. Bultje
R.S.Bultje at students.uu.nl
Wed Apr 7 05:32:23 CEST 2004
On Tue, 2004-04-06 at 21:43, Daniel Gazard wrote:
> 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:
I'll modify them slightly. The 8-bit reading functions (...) should be
replaced by a single one (without LE/BE). The functions in your "don't
support unaligned mem access" seem odd to me, since you bitshift guchar
and then cast the end result to the required type (e.g. guint64). As far
as I know, this is not allowed: you should cast first, then bitshift
(else, the bitshift will use a default 32bit length on popular archs,
therefore overflowing and losing information). So I'd propose changing
# define GST_READ_UINT64_BE(data) (((guint64) data) << 56 | \
((guint64) data) << 48 | \
((guint64) data) << 40 | \
((guint64) data) << 32 | \
((guint64) data) << 24 | \
((guint64) data) << 16 | \
((guint64) data) << 8 | \
((guint64) data) ))
Same for the others. I personally don't care much for the GST_PUCHAR()
and GST_GUINT64() macros, is there any reason why it was in there? The
above looks much more readable to me than your macros. ;).
Then, you seem to be doing something weird with GST_DISABLE_LOADSAFE in
the udpsink/tcpsink elements, can you elaborate on that? It seems like
you're disabling some _link() functions, which isn't a good idea.
Anyway, thanks for the patch. If you want, please provide a new patch.
Else I'll queue this somewhere on bugzilla and apply myself as soon as I
find some time to go over it and change the above.
More information about the gstreamer-devel