[MPlayer-dev-eng] [PATCH] - fix for audio and video in dvr-ms asf

Diego Biurrun diego at biurrun.de
Thu May 18 01:18:29 CEST 2006


On Sat, Apr 29, 2006 at 05:45:44PM -0500, John Donaghy wrote:
> >> >
> >> > +#if defined(ARCH_X86) || defined(ARCH_X86_64)
> >> > +#    define unaligned32(a) (*(const uint32_t*)(a))
> >> > +#else
> >> > +#    ifdef __GNUC__
> >> > +static inline uint32_t unaligned32(const void *v) {
> >> > +    struct Unaligned {
> >> > +        uint32_t i;
> >> > +    } __attribute__((packed));
> >> > +
> >> > +    return ((const struct Unaligned *) v)->i;
> >> > +}
> >> > +#    elif defined(__DECC)
> >> > +static inline uint32_t unaligned32(const void *v) {
> >> > +    return *(const __unaligned uint32_t *) v;
> >> > +}
> >> > +#    else
> >> > +static inline uint32_t unaligned32(const void *v) {
> >> > +    return *(const uint32_t *) v;
> >> > +}
> >> > +#    endif
> >> > +#endif //!ARCH_X86
> >> > +
> >>
> >> Ugh. Scary. Why can't you use the LOAD_LE32 macros? Or alternatively
> >> make similar LOAD_BE32 macros? This at least looks like both a
> >> portability and maintainability macros - at best acceptable in highly
> >> performance-critical code (if it makes a performance difference at all).
> 
> I've replaced this in the attached version with a LOAD_BE32 macro
> which I think is what you're suggesting but I'm not sure. It appears
> to work on x86 but I'm not very knowlegable in this area. Can you
> review and let me know if this is a correct and acceptable approach.

Reimar, are you OK with the patch now?  I can confirm that it works on
PPC.  It would be nice to have this in pre8.

Diego




More information about the MPlayer-dev-eng mailing list