comparison vmdav.c @ 4182:17d005bf07f2 libavcodec

Output proper 16-bit sound (fixes decoding on PPC)
author kostya
date Mon, 13 Nov 2006 05:15:55 +0000
parents c8c591fe26f8
children 42553b85aa7e
comparison
equal deleted inserted replaced
4181:580d2c397251 4182:17d005bf07f2
482 if (silence) { 482 if (silence) {
483 memset(data, 0, s->block_align * 2); 483 memset(data, 0, s->block_align * 2);
484 } else { 484 } else {
485 if (s->bits == 16) 485 if (s->bits == 16)
486 vmdaudio_decode_audio(s, data, buf, 1); 486 vmdaudio_decode_audio(s, data, buf, 1);
487 else 487 else {
488 /* copy the data but convert it to signed */ 488 /* copy the data but convert it to signed */
489 for (i = 0; i < s->block_align; i++) 489 for (i = 0; i < s->block_align; i++){
490 data[i * 2 + 1] = buf[i] + 0x80; 490 *data++ = buf[i] + 0x80;
491 *data++ = buf[i] + 0x80;
492 }
493 }
491 } 494 }
492 } else { 495 } else {
493 bytes_decoded = s->block_align * 2; 496 bytes_decoded = s->block_align * 2;
494 497
495 /* mono handling */ 498 /* mono handling */
498 } else { 501 } else {
499 if (s->bits == 16) { 502 if (s->bits == 16) {
500 vmdaudio_decode_audio(s, data, buf, 0); 503 vmdaudio_decode_audio(s, data, buf, 0);
501 } else { 504 } else {
502 /* copy the data but convert it to signed */ 505 /* copy the data but convert it to signed */
503 for (i = 0; i < s->block_align; i++) 506 for (i = 0; i < s->block_align; i++){
504 data[i * 2 + 1] = buf[i] + 0x80; 507 *data++ = buf[i] + 0x80;
508 *data++ = buf[i] + 0x80;
509 }
505 } 510 }
506 } 511 }
507 } 512 }
508 513
509 return s->block_align * 2; 514 return s->block_align * 2;