From: Josh Coalson Date: Thu, 5 Sep 2002 06:58:31 +0000 (+0000) Subject: fix bug where output resolution was being determined before it was read from the... X-Git-Tag: 1.2.0~1543 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9a30d66376cf60b0f8d615e356d3970f1cf57f92;p=platform%2Fupstream%2Fflac.git fix bug where output resolution was being determined before it was read from the FLAC file --- diff --git a/src/plugin_winamp2/in_flac.c b/src/plugin_winamp2/in_flac.c index 8349e36..63ce7ee 100644 --- a/src/plugin_winamp2/in_flac.c +++ b/src/plugin_winamp2/in_flac.c @@ -143,11 +143,7 @@ int play(char *fn) int maxlatency; int thread_id; HANDLE input_file = INVALID_HANDLE_VALUE; -#ifdef FLAC__DO_DITHER - const unsigned output_bits_per_sample = min(file_info_.bits_per_sample, 16); -#else - const unsigned output_bits_per_sample = file_info_.bits_per_sample; -#endif + unsigned output_bits_per_sample; if(0 == decoder_) { return 1; @@ -163,6 +159,12 @@ int play(char *fn) return 1; } +#ifdef FLAC__DO_DITHER + output_bits_per_sample = min(file_info_.bits_per_sample, 16); +#else + output_bits_per_sample = file_info_.bits_per_sample; +#endif + strcpy(lastfn_, fn); paused_ = 0; decode_pos_ms_ = 0; diff --git a/src/plugin_xmms/plugin.c b/src/plugin_xmms/plugin.c index fead857..c3fc3b1 100644 --- a/src/plugin_xmms/plugin.c +++ b/src/plugin_xmms/plugin.c @@ -160,7 +160,6 @@ void FLAC_XMMS__play_file(char *filename) { FILE *f; gchar *ret; - const AFormat output_format = file_info_.sample_format; wide_samples_in_reservoir_ = 0; audio_error_ = false; @@ -181,7 +180,7 @@ void FLAC_XMMS__play_file(char *filename) file_info_.is_playing = true; - if(flac_ip.output->open_audio(output_format, file_info_.sample_rate, file_info_.channels) == 0) { + if(flac_ip.output->open_audio(file_info_.sample_format, file_info_.sample_rate, file_info_.channels) == 0) { audio_error_ = true; safe_decoder_finish_(decoder_); return;