~ubuntu-branches/ubuntu/trusty/libsdl2/trusty-proposed

« back to all changes in this revision

Viewing changes to src/audio/SDL_wave.c

  • Committer: Package Import Robot
  • Author(s): Manuel A. Fernandez Montecelo
  • Date: 2013-12-28 12:31:19 UTC
  • mto: (7.1.3 sid)
  • mto: This revision was merged to the branch mainline in revision 7.
  • Revision ID: package-import@ubuntu.com-20131228123119-wehupm72qsjvh6vz
Tags: upstream-2.0.1+dfsg1
ImportĀ upstreamĀ versionĀ 2.0.1+dfsg1

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
        SDL_SwapLE16(format->bitspersample);
62
62
    rogue_feel = (Uint8 *) format + sizeof(*format);
63
63
    if (sizeof(*format) == 16) {
64
 
        /*const Uint16 extra_info = ((rogue_feel[1] << 8) | rogue_feel[0]);*/
 
64
        /* const Uint16 extra_info = ((rogue_feel[1] << 8) | rogue_feel[0]); */
65
65
        rogue_feel += sizeof(Uint16);
66
66
    }
67
67
    MS_ADPCM_state.wSamplesPerBlock = ((rogue_feel[1] << 8) | rogue_feel[0]);
242
242
        SDL_SwapLE16(format->bitspersample);
243
243
    rogue_feel = (Uint8 *) format + sizeof(*format);
244
244
    if (sizeof(*format) == 16) {
245
 
        /*const Uint16 extra_info = ((rogue_feel[1] << 8) | rogue_feel[0]);*/
 
245
        /* const Uint16 extra_info = ((rogue_feel[1] << 8) | rogue_feel[0]); */
246
246
        rogue_feel += sizeof(Uint16);
247
247
    }
248
248
    IMA_ADPCM_state.wSamplesPerBlock = ((rogue_feel[1] << 8) | rogue_feel[0]);
449
449
    /* Read the audio data format chunk */
450
450
    chunk.data = NULL;
451
451
    do {
452
 
        if (chunk.data != NULL) {
453
 
            SDL_free(chunk.data);
454
 
            chunk.data = NULL;
455
 
        }
 
452
        SDL_free(chunk.data);
 
453
        chunk.data = NULL;
456
454
        lenread = ReadChunk(src, &chunk);
457
455
        if (lenread < 0) {
458
456
            was_error = 1;
549
547
    /* Read the audio data chunk */
550
548
    *audio_buf = NULL;
551
549
    do {
552
 
        if (*audio_buf != NULL) {
553
 
            SDL_free(*audio_buf);
554
 
            *audio_buf = NULL;
555
 
        }
 
550
        SDL_free(*audio_buf);
 
551
        *audio_buf = NULL;
556
552
        lenread = ReadChunk(src, &chunk);
557
553
        if (lenread < 0) {
558
554
            was_error = 1;
583
579
    *audio_len &= ~(samplesize - 1);
584
580
 
585
581
  done:
586
 
    if (format != NULL) {
587
 
        SDL_free(format);
588
 
    }
 
582
    SDL_free(format);
589
583
    if (src) {
590
584
        if (freesrc) {
591
585
            SDL_RWclose(src);
606
600
void
607
601
SDL_FreeWAV(Uint8 * audio_buf)
608
602
{
609
 
    if (audio_buf != NULL) {
610
 
        SDL_free(audio_buf);
611
 
    }
 
603
    SDL_free(audio_buf);
612
604
}
613
605
 
614
606
static int