{
snd_fetcher_endsb_t fetcher_endsb = sfx->fetcher->endsb;
if (fetcher_endsb != NULL)
- fetcher_endsb (ch);
+ fetcher_endsb (&ch->fetcher_data);
}
// Remove the lock it holds
// Sound fetching functions
// "start" is both an input and output parameter: it returns the actual start time of the sound buffer
typedef const snd_buffer_t* (*snd_fetcher_getsb_t) (void *sfxfetcher, void **chfetcherpointer, unsigned int *start, unsigned int nbsampleframes);
-typedef void (*snd_fetcher_endsb_t) (channel_t* ch);
+typedef void (*snd_fetcher_endsb_t) (void **chfetcherpointer);
typedef void (*snd_fetcher_free_t) (sfx_t* sfx);
typedef const snd_format_t* (*snd_fetcher_getfmt_t) (sfx_t* sfx);
struct snd_fetcher_s
OGG_FetchEnd
====================
*/
-static void OGG_FetchEnd (channel_t* ch)
+static void OGG_FetchEnd (void **chfetcherpointer)
{
- ogg_stream_perchannel_t* per_ch;
+ ogg_stream_perchannel_t* per_ch = (ogg_stream_perchannel_t *)*chfetcherpointer;
- per_ch = (ogg_stream_perchannel_t *)ch->fetcher_data;
if (per_ch != NULL)
{
- size_t buff_len;
-
// Free the ogg vorbis decoder
qov_clear (&per_ch->vf);
- buff_len = per_ch->sb.maxframes * per_ch->sb.format.channels * per_ch->sb.format.width;
- ch->sfx->memsize -= sizeof (*per_ch) - sizeof (per_ch->sb.samples) + buff_len;
-
Mem_Free (per_ch);
- ch->fetcher_data = NULL;
}
+ *chfetcherpointer = NULL;
}