diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2007-04-18 16:22:40 +0100 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2007-04-18 16:22:40 +0100 |
commit | 48e77721372360e7dec0686f5fe2c3b543d308de (patch) | |
tree | f85a2cecd45f1fe65d9f2a9007d24204e64f03a2 /src | |
parent | b502e15322d2fe9c41645a0905683e7783cf2a30 (diff) | |
download | xine-lib-48e77721372360e7dec0686f5fe2c3b543d308de.tar.gz xine-lib-48e77721372360e7dec0686f5fe2c3b543d308de.tar.bz2 |
Limit common-case buffer copying optimisation to i386 & amd64.
This fixes reported alignment issues on ARM.
(We could require correct alignment on some architectures, but this is easier.)
Diffstat (limited to 'src')
-rw-r--r-- | src/xine-engine/input_cache.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/xine-engine/input_cache.c b/src/xine-engine/input_cache.c index a566e1f84..75c4beb43 100644 --- a/src/xine-engine/input_cache.c +++ b/src/xine-engine/input_cache.c @@ -74,7 +74,11 @@ static off_t cache_plugin_read(input_plugin_t *this_gen, char *buf, off_t len) { if (len <= (this->buf_len - this->buf_pos)) { /* all bytes are in the buffer */ switch (len) { -#if !(defined(sparc) || defined(__sparc__) || defined __ia64__) +#if defined(__i386__) || defined(__x86_64__) + /* These are restricted to x86 and amd64. Some other architectures don't + * handle unaligned accesses in the same way, quite possibly requiring + * extra code over and above simple byte copies. + */ case 8: *((uint64_t *)buf) = *(uint64_t *)(&(this->buf[this->buf_pos])); break; |