mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
commit patch for compiling on mingw32
This commit is contained in:
@@ -110,7 +110,7 @@ unsigned FLAC__fixed_compute_best_predictor_wide(const FLAC__int32 data[], unsig
|
||||
/* Estimate the expected number of bits per residual signal sample. */
|
||||
/* 'total_error*' is linearly related to the variance of the residual */
|
||||
/* signal, so we use it directly to compute E(|x|) */
|
||||
#ifdef _MSC_VER
|
||||
#if defined _MSC_VER || defined __MINGW32__
|
||||
/* with VC++ you have to spoon feed it the casting */
|
||||
residual_bits_per_sample[0] = (FLAC__real)((data_len > 0 && total_error_0 > 0) ? log(M_LN2 * (double)(FLAC__int64)total_error_0 / (double) data_len) / M_LN2 : 0.0);
|
||||
residual_bits_per_sample[1] = (FLAC__real)((data_len > 0 && total_error_1 > 0) ? log(M_LN2 * (double)(FLAC__int64)total_error_1 / (double) data_len) / M_LN2 : 0.0);
|
||||
|
||||
@@ -217,7 +217,7 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients(const FLAC__int32 data[],
|
||||
sum += qlp_coeff[j] * (*(--history));
|
||||
#ifdef FLAC__OVERFLOW_DETECT
|
||||
sumo += (FLAC__int64)qlp_coeff[j] * (FLAC__int64)(*history);
|
||||
#ifdef _MSC_VER /* don't know how to do 64-bit literals in VC++ */
|
||||
#if defined _MSC_VER || defined __MINGW32__ /* don't know how to do 64-bit literals in VC++ */
|
||||
if(sumo < 0) sumo = -sumo;
|
||||
if(sumo > 2147483647)
|
||||
#else
|
||||
@@ -268,7 +268,7 @@ void FLAC__lpc_restore_signal(const FLAC__int32 residual[], unsigned data_len, c
|
||||
sum += qlp_coeff[j] * (*(--history));
|
||||
#ifdef FLAC__OVERFLOW_DETECT
|
||||
sumo += (FLAC__int64)qlp_coeff[j] * (FLAC__int64)(*history);
|
||||
#ifdef _MSC_VER /* don't know how to do 64-bit literals in VC++ */
|
||||
#if defined _MSC_VER || defined __MINGW32__ /* don't know how to do 64-bit literals in VC++ */
|
||||
if(sumo < 0) sumo = -sumo;
|
||||
if(sumo > 2147483647)
|
||||
#else
|
||||
|
||||
@@ -636,7 +636,7 @@ FLAC__bool seek_to_absolute_sample_(FLAC__SeekableStreamDecoder *decoder, FLAC__
|
||||
const FLAC__uint64 target_offset = target_sample - decoder->private_->seek_table->points[lower_seek_point].sample_number;
|
||||
const FLAC__uint64 range_samples = decoder->private_->seek_table->points[upper_seek_point].sample_number - decoder->private_->seek_table->points[lower_seek_point].sample_number;
|
||||
const FLAC__uint64 range_bytes = upper_bound - lower_bound;
|
||||
#ifdef _MSC_VER
|
||||
#if defined _MSC_VER || defined __MINGW32__
|
||||
/* with VC++ you have to spoon feed it the casting */
|
||||
pos = (FLAC__int64)lower_bound + (FLAC__int64)((double)(FLAC__int64)target_offset / (double)(FLAC__int64)range_samples * (double)(FLAC__int64)(range_bytes-1)) - approx_bytes_per_frame;
|
||||
#else
|
||||
@@ -646,7 +646,7 @@ FLAC__bool seek_to_absolute_sample_(FLAC__SeekableStreamDecoder *decoder, FLAC__
|
||||
}
|
||||
if(pos < 0) {
|
||||
/* We need to use the metadata and the filelength to estimate the position of the frame with the correct sample */
|
||||
#ifdef _MSC_VER
|
||||
#if defined _MSC_VER || defined __MINGW32__
|
||||
/* with VC++ you have to spoon feed it the casting */
|
||||
pos = (FLAC__int64)first_frame_offset + (FLAC__int64)((double)(FLAC__int64)target_sample / (double)(FLAC__int64)decoder->private_->stream_info.total_samples * (double)(FLAC__int64)(stream_length-first_frame_offset-1)) - approx_bytes_per_frame;
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user