Mercurial > SDL_sound_CoreAudio
comparison decoders/shn.c @ 387:fb519e6028e3
Changed all the Sound_SetError() calls to __Sound_SetError (or BAIL*_MACRO)
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Fri, 05 Jul 2002 23:11:51 +0000 |
parents | cbb15ecf423a |
children | c42ac9ee2ce4 |
comparison
equal
deleted
inserted
replaced
386:8c8ecd1008c9 | 387:fb519e6028e3 |
---|---|
418 case SHN_TYPE_U16HL: | 418 case SHN_TYPE_U16HL: |
419 case SHN_TYPE_U16LH: | 419 case SHN_TYPE_U16LH: |
420 mean = 0x8000; | 420 mean = 0x8000; |
421 break; | 421 break; |
422 default: | 422 default: |
423 Sound_SetError("SHN: unknown file type"); | 423 __Sound_SetError("SHN: unknown file type"); |
424 return; | 424 return; |
425 } /* switch */ | 425 } /* switch */ |
426 | 426 |
427 for(chan = 0; chan < nchan; chan++) | 427 for(chan = 0; chan < nchan; chan++) |
428 { | 428 { |
638 if (shn->maxnlpc > 0) | 638 if (shn->maxnlpc > 0) |
639 { | 639 { |
640 shn->qlpc = (int *) malloc((Uint32) (shn->maxnlpc * sizeof (Sint32))); | 640 shn->qlpc = (int *) malloc((Uint32) (shn->maxnlpc * sizeof (Sint32))); |
641 if (shn->qlpc == NULL) | 641 if (shn->qlpc == NULL) |
642 { | 642 { |
643 Sound_SetError(ERR_OUT_OF_MEMORY); | 643 __Sound_SetError(ERR_OUT_OF_MEMORY); |
644 goto shn_open_puke; | 644 goto shn_open_puke; |
645 } /* if */ | 645 } /* if */ |
646 } /* if */ | 646 } /* if */ |
647 | 647 |
648 if (shn->version > 1) | 648 if (shn->version > 1) |
653 | 653 |
654 if ( (!uvar_get(SHN_FNSIZE, shn, rw, &cmd)) || | 654 if ( (!uvar_get(SHN_FNSIZE, shn, rw, &cmd)) || |
655 (cmd != SHN_FN_VERBATIM) || | 655 (cmd != SHN_FN_VERBATIM) || |
656 (!parse_riff_header(shn, sample)) ) | 656 (!parse_riff_header(shn, sample)) ) |
657 { | 657 { |
658 if (cmd != SHN_FN_VERBATIM) | 658 if (cmd != SHN_FN_VERBATIM) /* the other conditions set error state */ |
659 Sound_SetError("SHN: Expected VERBATIM function"); | 659 __Sound_SetError("SHN: Expected VERBATIM function"); |
660 | 660 |
661 goto shn_open_puke; | 661 goto shn_open_puke; |
662 return(0); | 662 return(0); |
663 } /* if */ | 663 } /* if */ |
664 | 664 |
665 shn->start_pos = SDL_RWtell(rw); | 665 shn->start_pos = SDL_RWtell(rw); |
666 | 666 |
667 shn = (shn_t *) malloc(sizeof (shn_t)); | 667 shn = (shn_t *) malloc(sizeof (shn_t)); |
668 if (shn == NULL) | 668 if (shn == NULL) |
669 { | 669 { |
670 Sound_SetError(ERR_OUT_OF_MEMORY); | 670 __Sound_SetError(ERR_OUT_OF_MEMORY); |
671 goto shn_open_puke; | 671 goto shn_open_puke; |
672 } /* if */ | 672 } /* if */ |
673 | 673 |
674 memcpy(shn, &_shn, sizeof (shn_t)); | 674 memcpy(shn, &_shn, sizeof (shn_t)); |
675 internal->decoder_private = shn; | 675 internal->decoder_private = shn; |
1288 } /* if */ | 1288 } /* if */ |
1289 break; | 1289 break; |
1290 | 1290 |
1291 case SHN_FN_VERBATIM: | 1291 case SHN_FN_VERBATIM: |
1292 default: | 1292 default: |
1293 Sound_SetError("SHN: Unhandled function."); | |
1294 sample->flags |= SOUND_SAMPLEFLAG_ERROR; | 1293 sample->flags |= SOUND_SAMPLEFLAG_ERROR; |
1295 return(retval); | 1294 BAIL_MACRO("SHN: Unhandled function.", retval); |
1296 } /* switch */ | 1295 } /* switch */ |
1297 } /* while */ | 1296 } /* while */ |
1298 | 1297 |
1299 return(retval); | 1298 return(retval); |
1300 } /* SHN_read */ | 1299 } /* SHN_read */ |