1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../xmms-jack/S16_LE.patch
5 # Copyright (C) 2004 - 2005 The T2 SDE Project
7 # More information can be found in the files COPYING and README.
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
15 # --- T2-COPYRIGHT-NOTE-END ---
17 Of course 16 bit little endian data needs to be swapped on big endian CPUs ...
19 (The same is of course true for big endian data on little endian CPUs - but
20 for now this should be enough.)
22 - Rene Rebe <rene@exactcode.de>
24 --- xmms-jack/jack.c 2004-11-30 04:23:27.000000000 +0100
25 +++ xmms-jack-fixed/jack.c 2005-03-08 16:59:17.000000000 +0100
28 #include "xconvert.h" /* xmms rate conversion header file */
31 +#include <byteswap.h>
33 /* set to 1 for verbose output */
34 #define VERBOSE_OUTPUT 0
36 /* loop until we have written all the data out to the jack device */
37 /* this is due to xmms' audio driver api */
38 char *buf = (char*)ptr;
40 +#ifdef __BIG_ENDIAN__
41 + if (new_format == FMT_S16_LE) {
42 + uint16_t* src = (uint16_t*) ptr;
43 + uint16_t* end = (uint16_t*) (ptr + length);
44 + while (src != end) {
45 + *src = bswap_16(*src);
53 TRACE("writing %d bytes\n", length);