浏览代码

examples/audio/starpu_audio_processing.c: reduce nsamples when bigger than length_data

Nathalie Furmento 8 年之前
父节点
当前提交
9ec0569732
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      examples/audio/starpu_audio_processing.c

+ 2 - 0
examples/audio/starpu_audio_processing.c

@@ -341,6 +341,8 @@ static void init_problem(void)
 	/* read length of input WAV's data */
 	/* each element is 2 bytes long (16bits)*/
 	length_data = get_wav_data_bytes_length(infile)/2;
+	while (nsamples > length_data)
+		nsamples /= 2;
 
 	/* allocate a buffer to store the content of input file */
 	if (use_pin)