music_flac.c
changeset 522 a70c0ee38c9f
parent 521 565549e046b0
child 524 0f6aa6179b1d
equal deleted inserted replaced
521:565549e046b0 522:a70c0ee38c9f
   409 /* Read some FLAC stream data and convert it for output */
   409 /* Read some FLAC stream data and convert it for output */
   410 static void FLAC_getsome(FLAC_music *music)
   410 static void FLAC_getsome(FLAC_music *music)
   411 {
   411 {
   412 	SDL_AudioCVT *cvt;
   412 	SDL_AudioCVT *cvt;
   413 
   413 
   414 	/* GET AUDIO wAVE DATA */
   414 	/* GET AUDIO WAVE DATA */
   415 	// set the max number of characters to read
   415 	// set the max number of characters to read
   416 	music->flac_data.max_to_read = 8192;
   416 	music->flac_data.max_to_read = 8192;
   417 
   417 
   418 	// clear out the data buffer if it exists
   418 	// clear out the data buffer if it exists
   419 	if (music->flac_data.data) {
   419 	if (music->flac_data.data) {
   442 					music->flac_data.overflow + music->flac_data.max_to_read,
   442 					music->flac_data.overflow + music->flac_data.max_to_read,
   443 					overflow_extra_len);
   443 					overflow_extra_len);
   444 				free (music->flac_data.overflow);
   444 				free (music->flac_data.overflow);
   445 				music->flac_data.overflow = new_overflow;
   445 				music->flac_data.overflow = new_overflow;
   446 				music->flac_data.overflow_len = overflow_extra_len;
   446 				music->flac_data.overflow_len = overflow_extra_len;
   447 				music->flac_data.overflow_read = 0;
   447 				music->flac_data.overflow_read = overflow_extra_len;
   448 				music->flac_data.max_to_read = 0;
   448 				music->flac_data.max_to_read = 0;
   449 			}
   449 			}
   450 			else {
   450 			else {
   451 				memcpy (music->flac_data.data+music->flac_data.data_read,
   451 				memcpy (music->flac_data.data+music->flac_data.data_read,
   452 					music->flac_data.overflow, overflow_len);
   452 					music->flac_data.overflow, overflow_len);