summaryrefslogtreecommitdiff
path: root/src/plugin_winamp2
diff options
context:
space:
mode:
authorJosh Coalson <jcoalson@users.sourceforce.net>2002-09-05 06:56:24 +0000
committerJosh Coalson <jcoalson@users.sourceforce.net>2002-09-05 06:56:24 +0000
commita70b3b68fc051be3c7282970105c127c353b0313 (patch)
treef8fcc3558a280074b4495ba009196602bc7a95df /src/plugin_winamp2
parent25521063be08f1f2053dfff414c71f5b6502899b (diff)
downloadflac-a70b3b68fc051be3c7282970105c127c353b0313.tar.gz
support 8bps in dither mode
Diffstat (limited to 'src/plugin_winamp2')
-rw-r--r--src/plugin_winamp2/in_flac.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugin_winamp2/in_flac.c b/src/plugin_winamp2/in_flac.c
index a00af4f4..8349e367 100644
--- a/src/plugin_winamp2/in_flac.c
+++ b/src/plugin_winamp2/in_flac.c
@@ -144,7 +144,7 @@ int play(char *fn)
int thread_id;
HANDLE input_file = INVALID_HANDLE_VALUE;
#ifdef FLAC__DO_DITHER
- const unsigned output_bits_per_sample = 16;
+ 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
@@ -290,7 +290,7 @@ DWORD WINAPI __stdcall DecodeThread(void *b)
const unsigned channels = file_info_.channels;
const unsigned bits_per_sample = file_info_.bits_per_sample;
#ifdef FLAC__DO_DITHER
- const unsigned target_bps = 16;
+ const unsigned target_bps = min(bits_per_sample, 16);
#else
const unsigned target_bps = bits_per_sample;
#endif
@@ -484,8 +484,8 @@ void metadata_callback_(const FLAC__FileDecoder *decoder, const FLAC__StreamMeta
file_info->sample_rate = metadata->data.stream_info.sample_rate;
#ifdef FLAC__DO_DITHER
- if(file_info->bits_per_sample != 16 && file_info->bits_per_sample != 24) {
- MessageBox(mod_.hMainWindow, "ERROR: plugin can only handle 16/24-bit samples\n", "ERROR: plugin can only handle 16/24-bit samples", 0);
+ if(file_info->bits_per_sample != 8 && file_info->bits_per_sample != 16 && file_info->bits_per_sample != 24) {
+ MessageBox(mod_.hMainWindow, "ERROR: plugin can only handle 8/16/24-bit samples\n", "ERROR: plugin can only handle 8/16/24-bit samples", 0);
file_info->abort_flag = true;
return;
}