diff options
author | Michel Dänzer <michel@tungstengraphics.com> | 2007-01-15 17:14:56 +0100 |
---|---|---|
committer | Michel Dänzer <michel@tungstengraphics.com> | 2007-01-15 17:17:06 +0100 |
commit | 29190804b219bf3e6289426a832b32ad2f4c53a4 (patch) | |
tree | 58454e6596da2c9bcd89b05c66b2001229d8b92a /xvinfo.c | |
parent | 69758559c5ddb85bbf6501ea8e58c0896c7c1f11 (diff) |
Fix FourCC name output on big endian platforms.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=9665 .
Diffstat (limited to 'xvinfo.c')
-rw-r--r-- | xvinfo.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -168,7 +168,7 @@ int main(int argc, char *argv[]) } if(ImageEncodings && (ainfo[j].type & XvImageMask)) { - char imageName[5] = {0, 0, 0, 0, 0}; + char imageName[5]; for(n = 0; n < nencode; n++) { if(!strcmp(encodings[n].name, "XV_IMAGE")) { @@ -186,7 +186,10 @@ int main(int argc, char *argv[]) numImages); for(n = 0; n < numImages; n++) { - memcpy(imageName, &(formats[n].id), 4); + sprintf(imageName, "%c%c%c%c", formats[n].id & 0xff, + (formats[n].id >> 8) & 0xff, + (formats[n].id >> 16) & 0xff, + (formats[n].id >> 24) & 0xff); fprintf(stdout, " id: 0x%x", formats[n].id); if(isprint(imageName[0]) && isprint(imageName[1]) && isprint(imageName[2]) && isprint(imageName[3])) |