Revision 8a1f657b

View differences:

libavcodec/ra144.c
424 424

  
425 425
/* Uncompress one block (20 bytes -> 160*2 bytes) */
426 426
static int ra144_decode_frame(AVCodecContext * avctx,
427
            void *data, int *data_size,
427
            void *vdata, int *data_size,
428 428
            uint8_t * buf, int buf_size)
429 429
{
430 430
  unsigned int a,b,c;
......
432 432
  signed short *shptr;
433 433
  unsigned int *lptr,*temp;
434 434
  const short **dptr;
435
  void *datao;
435
  int16_t *datao;
436
  int16_t *data = vdata;
436 437
  Real144_internal *glob=avctx->priv_data;
437 438

  
438 439
  datao = data;
......
480 481
    shptr=glob->output_buffer;
481 482
    while (shptr<glob->output_buffer+BLOCKSIZE) {
482 483
      s=*(shptr++)<<2;
483
      *((int16_t *)data)=s;
484
      if (s>32767) *((int16_t *)data)=32767;
485
      if (s<-32767) *((int16_t *)data)=-32768;
486
      ((int16_t *)data)++;
484
      *data=s;
485
      if (s>32767) *data=32767;
486
      if (s<-32767) *data=-32768;
487
      data++;
487 488
    }
488 489
    b+=30;
489 490
  }
......
495 496
  temp=glob->swapbuf2alt;
496 497
  glob->swapbuf2alt=glob->swapbuf2;
497 498
  glob->swapbuf2=temp;
498
  *data_size=data-datao;
499
  *data_size=(data-datao)*sizeof(*data);
499 500
  return 20;
500 501
}
501 502

  

Also available in: Unified diff