Mercurial > mplayer.hg
annotate osdep/swab.c @ 17559:4ae8c0169017
expanded and improved NeoMagic TV-out section
based on a patch by Helio Polis, simplesmoke_at_hotmail_dot_com
author | diego |
---|---|
date | Wed, 08 Feb 2006 12:17:41 +0000 |
parents | 08cac43f1e38 |
children | a9a7d6d85020 |
rev | line source |
---|---|
16985 | 1 #include "config.h" |
13612 | 2 |
3 #ifndef HAVE_SWAB | |
4 /* system has no swab. emulate via bswap */ | |
16985 | 5 #include "bswap.h" |
13612 | 6 #include <unistd.h> |
7 | |
8 void swab(const void *from, void *to, ssize_t n) { | |
9 const int16_t *in = (int16_t*)from; | |
10 int16_t *out = (int16_t*)to; | |
11 int i; | |
12 n /= 2; | |
13 for (i = 0 ; i < n; i++) { | |
14 out[i] = bswap_16(in[i]); | |
15 } | |
16 } | |
17 #endif |