]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
eliminated channel_t reference in OGG_FetchEnd
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 30 Aug 2007 12:55:17 +0000 (12:55 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 30 Aug 2007 12:55:17 +0000 (12:55 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7549 d7cf8633-e32d-0410-b094-e92efae38249

snd_main.c
snd_main.h
snd_ogg.c

index e1e03a58c7976d403ca46828011ab2f190de31e0..f5991953792951d75922b3c45ad7d2b1d98d9400 100644 (file)
@@ -1248,7 +1248,7 @@ void S_StopChannel (unsigned int channel_ind)
                {
                        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
index 51d2820dea73e8bb95a0d1c41833010d7b3bde49..eb4f4fb19c27407f03291392f94959d625047098 100644 (file)
@@ -97,7 +97,7 @@ typedef struct channel_s
 // 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
index ccedb504c5e7260d69c3b6e5bc5d7246871425d1..b8ab271fa9cd78b4118773632c43f2ef0e5ddafe 100644 (file)
--- a/snd_ogg.c
+++ b/snd_ogg.c
@@ -567,24 +567,18 @@ static const snd_buffer_t* OGG_FetchSound (void *sfxfetcher, void **chfetcherpoi
 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;
 }