summaryrefslogtreecommitdiff
path: root/formats/format_wav.c
diff options
context:
space:
mode:
Diffstat (limited to 'formats/format_wav.c')
-rw-r--r--formats/format_wav.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/formats/format_wav.c b/formats/format_wav.c
index fa8d5766d..5ea4fab41 100644
--- a/formats/format_wav.c
+++ b/formats/format_wav.c
@@ -355,7 +355,6 @@ static struct ast_frame *wav_read(struct ast_filestream *s, int *whennext)
#if __BYTE_ORDER == __BIG_ENDIAN
int x;
#endif
- short *tmp;
int bytes;
off_t here;
/* Send a frame from the file to the appropriate channel */
@@ -382,8 +381,8 @@ static struct ast_frame *wav_read(struct ast_filestream *s, int *whennext)
s->fr.datalen = res;
s->fr.samples = samples = res / 2;
- tmp = (short *)(s->fr.data.ptr);
#if __BYTE_ORDER == __BIG_ENDIAN
+ tmp = (short *)(s->fr.data.ptr);
/* file format is little endian so we need to swap */
for( x = 0; x < samples; x++)
tmp[x] = (tmp[x] << 8) | ((tmp[x] & 0xff00) >> 8);