summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-02-04 16:03:10 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-02-04 16:03:10 +0000
commit8a1f657b28024ed9c3b137baaafbf0a8737de142 (patch)
tree7b399421c856ed63a60d6662bbc75bfb4d8ec091 /libavcodec
parent2caa92d9358c53fccc424c5892df817c2c13b1e4 (diff)
cleanup ugly code (also appearently works around a bug gcc 3.4 which fails compiling it) by (mru at kth dot se (Måns Rullgård))
Originally committed as revision 2746 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/ra144.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/libavcodec/ra144.c b/libavcodec/ra144.c
index 2d882f7444..27b9ae8f81 100644
--- a/libavcodec/ra144.c
+++ b/libavcodec/ra144.c
@@ -424,7 +424,7 @@ static void dec2(Real144_internal *glob, int *data, int *inp, int n, int f, int
/* Uncompress one block (20 bytes -> 160*2 bytes) */
static int ra144_decode_frame(AVCodecContext * avctx,
- void *data, int *data_size,
+ void *vdata, int *data_size,
uint8_t * buf, int buf_size)
{
unsigned int a,b,c;
@@ -432,7 +432,8 @@ static int ra144_decode_frame(AVCodecContext * avctx,
signed short *shptr;
unsigned int *lptr,*temp;
const short **dptr;
- void *datao;
+ int16_t *datao;
+ int16_t *data = vdata;
Real144_internal *glob=avctx->priv_data;
datao = data;
@@ -480,10 +481,10 @@ static int ra144_decode_frame(AVCodecContext * avctx,
shptr=glob->output_buffer;
while (shptr<glob->output_buffer+BLOCKSIZE) {
s=*(shptr++)<<2;
- *((int16_t *)data)=s;
- if (s>32767) *((int16_t *)data)=32767;
- if (s<-32767) *((int16_t *)data)=-32768;
- ((int16_t *)data)++;
+ *data=s;
+ if (s>32767) *data=32767;
+ if (s<-32767) *data=-32768;
+ data++;
}
b+=30;
}
@@ -495,7 +496,7 @@ static int ra144_decode_frame(AVCodecContext * avctx,
temp=glob->swapbuf2alt;
glob->swapbuf2alt=glob->swapbuf2;
glob->swapbuf2=temp;
- *data_size=data-datao;
+ *data_size=(data-datao)*sizeof(*data);
return 20;
}