diff options
author | Harald Welte <laforge@gnumonks.org> | 2009-04-29 16:21:18 +0000 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2009-04-29 16:21:18 +0000 |
commit | 360f06cba31d9f27e53cf7a23b5bfc6384961b21 (patch) | |
tree | 5336766fce0363c2d9b598fcec00c47d304a7bc0 | |
parent | 70128d03dfea0ab7df68b83a263cbf526c344550 (diff) |
Fix order of subchannel bits (Andreas Eversberg)
-rw-r--r-- | src/subchan_demux.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/subchan_demux.c b/src/subchan_demux.c index 4b1efd5cc..c662bcd0e 100644 --- a/src/subchan_demux.c +++ b/src/subchan_demux.c @@ -100,7 +100,7 @@ int subch_demux_in(struct subch_demux *dmx, u_int8_t *data, int len) 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 @@ static int mux_output_byte(struct subch_mux *mx, u_int8_t *byte) 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); |