load_flac.c
changeset 613 6fa075aa693e
parent 601 05123263dab3
child 617 87116a42526e
equal deleted inserted replaced
612:e795460706d0 613:6fa075aa693e
    59 		FLAC_SDL_Data *data = (FLAC_SDL_Data *)client_data;
    59 		FLAC_SDL_Data *data = (FLAC_SDL_Data *)client_data;
    60 
    60 
    61 		*bytes = SDL_RWread (data->sdl_src, buffer, sizeof (FLAC__byte),
    61 		*bytes = SDL_RWread (data->sdl_src, buffer, sizeof (FLAC__byte),
    62 								*bytes);
    62 								*bytes);
    63 
    63 
    64 		if(*bytes < 0) { // error in read
    64 		if (*bytes == 0) { // error or no data was read (EOF)
    65 			return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
       
    66 		}
       
    67 		else if(*bytes == 0) { // no data was read (EOF)
       
    68 			return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
    65 			return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
    69 		}
    66 		}
    70 		else { // data was read, continue
    67 		else { // data was read, continue
    71 			return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
    68 			return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
    72 		}
    69 		}