diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/vorbis2wav.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/plugins/vorbis2wav.c b/apps/plugins/vorbis2wav.c index 3b5de72c74..93c1be6a98 100644 --- a/apps/plugins/vorbis2wav.c +++ b/apps/plugins/vorbis2wav.c | |||
@@ -30,6 +30,7 @@ static struct plugin_api* rb; | |||
30 | 30 | ||
31 | /* Some standard functions and variables needed by Tremor */ | 31 | /* Some standard functions and variables needed by Tremor */ |
32 | 32 | ||
33 | |||
33 | int errno; | 34 | int errno; |
34 | 35 | ||
35 | size_t strlen(const char *s) { | 36 | size_t strlen(const char *s) { |
@@ -92,6 +93,10 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file) | |||
92 | int current_section; | 93 | int current_section; |
93 | int eof; | 94 | int eof; |
94 | static char pcmbuf[4096]; | 95 | static char pcmbuf[4096]; |
96 | #if BYTE_ORDER == BIG_ENDIAN | ||
97 | int i; | ||
98 | char x; | ||
99 | #endif | ||
95 | 100 | ||
96 | file_info_struct file_info; | 101 | file_info_struct file_info; |
97 | 102 | ||
@@ -139,6 +144,11 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file) | |||
139 | dprintf("Error decoding frame\n"); | 144 | dprintf("Error decoding frame\n"); |
140 | } else { | 145 | } else { |
141 | file_info.frames_decoded++; | 146 | file_info.frames_decoded++; |
147 | #if BYTE_ORDER == BIG_ENDIAN | ||
148 | for (i=0;i<n;i+=2) { | ||
149 | x=pcmbuf[i]; pcmbuf[i]=pcmbuf[i+1]; pcmbuf[i+1]=x; | ||
150 | } | ||
151 | #endif | ||
142 | rb->write(file_info.outfile,pcmbuf,n); | 152 | rb->write(file_info.outfile,pcmbuf,n); |
143 | file_info.current_sample+=(n/4); | 153 | file_info.current_sample+=(n/4); |
144 | } | 154 | } |