]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_video.c
Removed the functions "S_RawSamples_*" and "S_ResampleBuffer16Stereo". They're useles...
[xonotic/darkplaces.git] / cl_video.c
index c6c094c365995c03bd292ffa81f83dca56c4b5ba..165f1b067bb75b9c00b3ea822fae6b9c2980dd3f 100644 (file)
@@ -20,18 +20,12 @@ int cl_videoimagedata_bmask;
 int cl_videoimagedata_bytesperpixel;
 void *cl_videoimagedata;
 
-int cl_videosoundrate;
-int cl_videosoundlength;
-short *cl_videosounddata;
-int cl_videosoundresamplelength;
-short *cl_videosoundresampledata;
-
 rtexture_t *cl_videotexture;
 rtexturepool_t *cl_videotexturepool;
 
 void CL_VideoFrame(void)
 {
-       int frames, framenum, samples, s;
+       int frames, framenum;
        if (!cl_videoplaying)
                return;
        framenum = (realtime - cl_videostarttime) * cl_videoframerate;
@@ -54,35 +48,6 @@ void CL_VideoFrame(void)
                R_UpdateTexture(cl_videotexture, cl_videoimagedata);
                //Draw_NewPic("engine_videoframe", cl_videoimagewidth, cl_videoimageheight, false, cl_videoimagedata);
        }
-       if (cl_videosoundrate && (samples = S_RawSamples_QueueWantsMore()))
-       {
-               Con_DPrintf("%i = S_RawSamples_QueueWantsMore()\n", samples);
-
-               // calculate how much source data we need to fill the output...
-               s = samples * cl_videosoundrate / S_RawSamples_SampleRate();
-
-               // reallocate processing buffer if needed
-               if (cl_videosoundresamplelength < samples)
-               {
-                       cl_videosoundresamplelength = samples + 100;
-                       if (cl_videosoundresampledata)
-                               Mem_Free(cl_videosoundresampledata);
-                       cl_videosoundresampledata = Mem_Alloc(clvideomempool, cl_videosoundresamplelength * sizeof(short[2]));
-               }
-
-               // reallocate loading buffer if needed
-               if (cl_videosoundlength < s)
-               {
-                       cl_videosoundlength = s + 100;
-                       if (cl_videosounddata)
-                               Mem_Free(cl_videosounddata);
-                       cl_videosounddata = Mem_Alloc(clvideomempool, cl_videosoundlength * sizeof(short[2]));
-               }
-
-               dpvsimpledecode_audio(cl_videostream, cl_videosounddata, s);
-               S_ResampleBuffer16Stereo(cl_videosounddata, s, cl_videosoundresampledata, samples);
-               S_RawSamples_Enqueue(cl_videosoundresampledata, samples);
-       }
 }
 
 void CL_DrawVideo(void)
@@ -145,12 +110,6 @@ void CL_VideoStart(char *filename)
        cl_videoimagedata = Mem_Alloc(clvideomempool, cl_videoimagewidth * cl_videoimageheight * cl_videoimagedata_bytesperpixel);
        //memset(cl_videoimagedata, 97, cl_videoimagewidth * cl_videoimageheight * cl_videoimagedata_bytesperpixel);
 
-       cl_videosoundrate = dpvsimpledecode_getsoundrate(cl_videostream);
-       cl_videosoundlength = 0;
-       cl_videosounddata = NULL;
-       cl_videosoundresamplelength = 0;
-       cl_videosoundresampledata = NULL;
-
        cl_videotexturepool = R_AllocTexturePool();
        cl_videotexture = R_LoadTexture2D(cl_videotexturepool, "videotexture", cl_videoimagewidth, cl_videoimageheight, NULL, TEXTYPE_RGBA, TEXF_FRAGMENT, NULL);
 }
@@ -159,8 +118,6 @@ void CL_VideoStop(void)
 {
        cl_videoplaying = false;
 
-       S_RawSamples_ClearQueue();
-
        if (cl_videostream)
                dpvsimpledecode_close(cl_videostream);
        cl_videostream = NULL;
@@ -169,14 +126,6 @@ void CL_VideoStop(void)
                Mem_Free(cl_videoimagedata);
        cl_videoimagedata = NULL;
 
-       if (cl_videosounddata)
-               Mem_Free(cl_videosounddata);
-       cl_videosounddata = NULL;
-
-       if (cl_videosoundresampledata)
-               Mem_Free(cl_videosoundresampledata);
-       cl_videosoundresampledata = NULL;
-
        cl_videotexture = NULL;
        R_FreeTexturePool(&cl_videotexturepool);