From 5c04d6694645b8f11eaab675859c6814c31b44e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Thu, 17 Sep 2009 20:22:25 +0000 Subject: [PATCH] Support cards that only returns even OR odd control words --- src/cwc.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/cwc.c b/src/cwc.c index 561342b2..08baa6f1 100644 --- a/src/cwc.c +++ b/src/cwc.c @@ -510,6 +510,7 @@ cwc_running_reply(cwc_t *cwc, uint8_t msgtype, uint8_t *msg, int len) cwc_transport_t *ct; uint16_t seq = (msg[2] << 8) | msg[3]; th_transport_t *t; + int j; len -= 12; msg += 12; @@ -546,7 +547,20 @@ cwc_running_reply(cwc_t *cwc, uint8_t msgtype, uint8_t *msg, int len) ct->ct_keystate = CT_RESOLVED; pthread_mutex_lock(&t->tht_stream_mutex); - set_control_words(ct->ct_keys, msg + 3, msg + 3 + 8); + + + for(j = 0; j < 8; j++) + if(msg[3 + j]) { + set_even_control_word(ct->ct_keys, msg + 3); + break; + } + + for(j = 0; j < 8; j++) + if(msg[3 + 8 +j]) { + set_odd_control_word(ct->ct_keys, msg + 3 + 8); + break; + } + pthread_mutex_unlock(&t->tht_stream_mutex); break; }