summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-08-14 09:01:35 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-08-14 09:01:56 +0200
commit93f6591c6f471c5b0c84abefeb2be2d8034c8855 (patch)
tree48d89a20ae80f9a7f22649d74cc94dfd81dba55c
parentc1f326e893665dd95d4a68111b02324ad0498cf6 (diff)
fixed bits per sample display in libsndfile plugin (wav files)
-rw-r--r--plugins/sndfile/sndfile.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/plugins/sndfile/sndfile.c b/plugins/sndfile/sndfile.c
index 8535d1fd..0cb48675 100644
--- a/plugins/sndfile/sndfile.c
+++ b/plugins/sndfile/sndfile.c
@@ -110,7 +110,29 @@ sndfile_init (DB_fileinfo_t *_info, DB_playItem_t *it) {
return -1;
}
_info->plugin = &plugin;
- _info->bps = 16;
+
+ switch (inf.format&0x000f) {
+ case SF_FORMAT_PCM_S8:
+ case SF_FORMAT_PCM_U8:
+ _info->bps = 8;
+ break;
+ case SF_FORMAT_PCM_16:
+ _info->bps = 16;
+ break;
+ case SF_FORMAT_PCM_24:
+ _info->bps = 24;
+ break;
+ case SF_FORMAT_PCM_32:
+ case SF_FORMAT_FLOAT:
+ _info->bps = 24;
+ break;
+ case SF_FORMAT_DOUBLE:
+ _info->bps = 64;
+ break;
+ default:
+ _info->bps = 16;
+ }
+
_info->channels = inf.channels;
_info->samplerate = inf.samplerate;
_info->readpos = 0;
@@ -250,7 +272,7 @@ sndfile_insert (DB_playItem_t *after, const char *fname) {
}
static const char * exts[] = { "wav", "aif", "aiff", "snd", "au", "paf", "svx", "nist", "voc", "ircam", "w64", "mat4", "mat5", "pvf", "xi", "htk", "sds", "avr", "wavex", "sd2", "caf", "wve", NULL };
-static const char *filetypes[] = { "wav", NULL };
+static const char *filetypes[] = { "WAV", NULL };
// define plugin interface
static DB_decoder_t plugin = {