Переглянути джерело

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)