OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.7 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../xmms-jack/S16_LE.patch
  5. # Copyright (C) 2004 - 2006 The T2 SDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  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
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. Of course 16 bit little endian data needs to be swapped on big endian CPUs ...
  17. (The same is of course true for big endian data on little endian CPUs - but
  18. for now this should be enough.)
  19. - Rene Rebe <rene@exactcode.de>
  20. --- xmms-jack/jack.c 2004-11-30 04:23:27.000000000 +0100
  21. +++ xmms-jack-fixed/jack.c 2005-03-08 16:59:17.000000000 +0100
  22. @@ -13,7 +13,7 @@
  23. #include "jack.h"
  24. #include "xconvert.h" /* xmms rate conversion header file */
  25. -
  26. +#include <byteswap.h>
  27. /* set to 1 for verbose output */
  28. #define VERBOSE_OUTPUT 0
  29. @@ -437,6 +437,18 @@
  30. /* loop until we have written all the data out to the jack device */
  31. /* this is due to xmms' audio driver api */
  32. char *buf = (char*)ptr;
  33. +
  34. +#ifdef __BIG_ENDIAN__
  35. + if (new_format == FMT_S16_LE) {
  36. + uint16_t* src = (uint16_t*) ptr;
  37. + uint16_t* end = (uint16_t*) (ptr + length);
  38. + while (src != end) {
  39. + *src = bswap_16(*src);
  40. + src++;
  41. + }
  42. + }
  43. +#endif
  44. +
  45. while(length > 0)
  46. {
  47. TRACE("writing %d bytes\n", length);