Revision 7372f88d audio/wavaudio.c

b/audio/wavaudio.c
55 55
    int64_t now = qemu_get_clock (vm_clock);
56 56
    int64_t ticks = now - wav->old_ticks;
57 57
    int64_t bytes = (ticks * hw->bytes_per_second) / ticks_per_sec;
58
    wav->old_ticks = now;
59 58

  
60 59
    if (bytes > INT_MAX)
61 60
        samples = INT_MAX >> hw->shift;
......
66 65
    if (live <= 0)
67 66
        return;
68 67

  
68
    wav->old_ticks = now;
69 69
    decr = audio_MIN (live, samples);
70 70
    samples = decr;
71 71
    rpos = hw->rpos;
......
94 94
    return pcm_hw_write (sw, buf, len);
95 95
}
96 96

  
97

  
98 97
/* VICE code: Store number as little endian. */
99 98
static void le_store (uint8_t *buf, uint32_t val, int len)
100 99
{
......
145 144
    if (!wav->f) {
146 145
        dolog ("failed to open wave file `%s'\nReason: %s\n",
147 146
               conf.wav_path, strerror (errno));
147
        qemu_free (wav->pcm_buf);
148
        wav->pcm_buf = NULL;
148 149
        return -1;
149 150
    }
150 151

  
......
175 176

  
176 177
    fclose (wav->f);
177 178
    wav->f = NULL;
179

  
180
    qemu_free (wav->pcm_buf);
181
    wav->pcm_buf = NULL;
178 182
}
179 183

  
180 184
static int wav_hw_ctl (HWVoice *hw, int cmd, ...)

Also available in: Unified diff