소스 검색

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)