]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Added NOSTREAM 1 tag for ogg files
authorReki <spiper212@gmail.com>
Thu, 15 Apr 2021 03:59:32 +0000 (23:59 -0400)
committerReki <spiper212@gmail.com>
Thu, 15 Apr 2021 03:59:32 +0000 (23:59 -0400)
snd_ogg.c

index 09d20c8e307c0e2d9c9c93397c5cf8577957dff4..f5ea5561f1d6ee4963b51bf0836992c00bb674bb 100644 (file)
--- a/snd_ogg.c
+++ b/snd_ogg.c
@@ -649,8 +649,12 @@ qbool OGG_LoadVorbisFile(const char *filename, sfx_t *sfx)
        sfx->format.width = 2;  // We always work with 16 bits samples
 
        sfx->total_length = qov_pcm_total(&vf, -1);
-
-       if (snd_streaming.integer && (snd_streaming.integer >= 2 || sfx->total_length > max(sizeof(ogg_stream_perchannel_t), snd_streaming_length.value * sfx->format.speed)))
+       
+       vc = qov_comment(&vf, -1);
+       const char *nostream = NULL;
+       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)))
        {
                // 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;
@@ -664,7 +668,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);
        }
@@ -688,7 +692,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);