summaryrefslogtreecommitdiff
path: root/plugins/dca
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-10-01 22:24:04 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-10-01 22:24:04 +0200
commitf8b01f43876a5c5f6c413c5d8f6b39f5cfa3f654 (patch)
tree374f86557031ee786d9085a94b409e1699ac7836 /plugins/dca
parentd98b221214754a1af4dab77f61f077c1640d035b (diff)
fixed dts nchannels display
Diffstat (limited to 'plugins/dca')
-rw-r--r--plugins/dca/dcaplug.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/plugins/dca/dcaplug.c b/plugins/dca/dcaplug.c
index e160f7b6..2757e155 100644
--- a/plugins/dca/dcaplug.c
+++ b/plugins/dca/dcaplug.c
@@ -397,7 +397,41 @@ dts_init (DB_fileinfo_t *_info, DB_playItem_t *it) {
}
info->frame_byte_size = len;
- _info->channels = channels_multi (info->flags);
+ int flags = info->flags &~ (DCA_LFE | DCA_ADJUST_LEVEL);
+ switch (flags) {
+ case DCA_MONO:
+ _info->channels = 1;
+ break;
+ case DCA_CHANNEL:
+ case DCA_STEREO:
+ case DCA_DOLBY:
+ case DCA_STEREO_SUMDIFF:
+ case DCA_STEREO_TOTAL:
+ _info->channels = 2;
+ break;
+ case DCA_3F:
+ case DCA_2F1R:
+ _info->channels = 3;
+ break;
+ case DCA_2F2R:
+ case DCA_3F1R:
+ _info->channels = 4;
+ break;
+ case DCA_3F2R:
+ _info->channels = 5;
+ case DCA_4F2R:
+ _info->channels = 6;
+ break;
+ }
+
+ if (info->flags & DCA_LFE) {
+ _info->channels++;
+ }
+ if (!_info->channels) {
+ trace ("dts: invalid numchannels\n");
+ return -1;
+ }
+
_info->samplerate = info->sample_rate;
if (it->endsample > 0) {