Fix order of subchannel bits (Andreas Eversberg)
diff --git a/src/subchan_demux.c b/src/subchan_demux.c
index 4b1efd5..c662bcd 100644
--- a/src/subchan_demux.c
+++ b/src/subchan_demux.c
@@ -100,7 +100,7 @@
if (!(dmx->chan_activ & (1 << c)))
continue;
- inbits = inbyte >> ((3-c)*2);
+ inbits = inbyte >> (c << 1);
/* two bits for each subchannel */
if (inbits & 0x01)
@@ -230,10 +230,10 @@
int rc;
/* combine two bits of every subchan */
- rc = get_subch_bits(mx, 3, &bits[0], 2);
- rc = get_subch_bits(mx, 2, &bits[2], 2);
- rc = get_subch_bits(mx, 1, &bits[4], 2);
- rc = get_subch_bits(mx, 0, &bits[6], 2);
+ rc = get_subch_bits(mx, 0, &bits[0], 2);
+ rc = get_subch_bits(mx, 1, &bits[2], 2);
+ rc = get_subch_bits(mx, 2, &bits[4], 2);
+ rc = get_subch_bits(mx, 3, &bits[6], 2);
*byte = compact_bits(bits);