From: kristus Date: Thu, 29 Apr 2021 18:10:18 +0000 (+0200) Subject: Reverted snd_ogg.c to DP master. Changes caused Segfault on Linux X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e5aaf72c224bbced4fd4ab332a4a5ce2cfb5c31f;p=xonotic%2Fdarkplaces.git Reverted snd_ogg.c to DP master. Changes caused Segfault on Linux --- diff --git a/snd_ogg.c b/snd_ogg.c index f04d76be..c1d8b96c 100644 --- a/snd_ogg.c +++ b/snd_ogg.c @@ -598,7 +598,6 @@ Load an Ogg Vorbis file into memory qbool OGG_LoadVorbisFile(const char *filename, sfx_t *sfx) { unsigned char *data; - const char *nostream = NULL; fs_offset_t filesize; ov_decode_t ov_decode; OggVorbis_File vf; @@ -651,11 +650,7 @@ qbool OGG_LoadVorbisFile(const char *filename, sfx_t *sfx) sfx->total_length = qov_pcm_total(&vf, -1); - vc = qov_comment(&vf, -1); - - nostream = qvorbis_comment_query(vc, "NOSTREAM", 0); - - if (snd_streaming.integer && !atof(nostream) && (snd_streaming.integer >= 2 || sfx->total_length > max(sizeof(ogg_stream_perchannel_t), snd_streaming_length.value * sfx->format.speed))) + if (snd_streaming.integer && (snd_streaming.integer >= 2 || sfx->total_length > max(sizeof(ogg_stream_perchannel_t), snd_streaming_length.value * sfx->format.speed))) { // large sounds use the OGG fetcher to decode the file on demand (but the entire file is held in memory) ogg_stream_persfx_t* per_sfx; @@ -669,7 +664,7 @@ qbool OGG_LoadVorbisFile(const char *filename, sfx_t *sfx) sfx->fetcher_data = per_sfx; sfx->fetcher = &ogg_fetcher; sfx->flags |= SFXFLAG_STREAMED; - //vc = qov_comment(&vf, -1); + vc = qov_comment(&vf, -1); OGG_DecodeTags(vc, &sfx->loopstart, &sfx->total_length, sfx->total_length, &peak, &gaindb); qov_clear(&vf); } @@ -693,7 +688,7 @@ qbool OGG_LoadVorbisFile(const char *filename, sfx_t *sfx) bs = 0; while ((ret = qov_read(&vf, &buff[done], (int)(len - done), mem_bigendian, 2, 1, &bs)) > 0) done += ret; - //vc = qov_comment(&vf, -1); + vc = qov_comment(&vf, -1); OGG_DecodeTags(vc, &sfx->loopstart, &sfx->total_length, sfx->total_length, &peak, &gaindb); qov_clear(&vf); Mem_Free(data);