Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
cwc: Fix the emm tables shutdown sequence
  • Loading branch information
perexg committed Aug 8, 2014
1 parent 47a1cbc commit c1166d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/descrambler/cwc.c
Expand Up @@ -2146,11 +2146,11 @@ cwc_caid_update(mpegts_mux_t *mux, uint16_t caid, uint16_t pid, int valid)
mux, caid, caid, pid, pid, valid);
pthread_mutex_lock(&cwc_mutex);
TAILQ_FOREACH(cwc, &cwcs, cwc_link) {
if (cwc->cwc_running) {
if (valid < 0 || cwc->cwc_running) {
LIST_FOREACH(pcard, &cwc->cwc_cards, cs_card) {
if (pcard->cwc_caid == caid) {
if (valid < 0 || pcard->cwc_caid == caid) {
if (pcard->cwc_mux && pcard->cwc_mux != mux) continue;
if (valid) {
if (valid > 0) {
pcard->cwc = cwc;
pcard->cwc_mux = mux;
descrambler_open_emm(mux, pcard, caid, cwc_emm);
Expand Down
3 changes: 3 additions & 0 deletions src/descrambler/descrambler.c
Expand Up @@ -573,6 +573,9 @@ descrambler_flush_tables( mpegts_mux_t *mux )
if (mux == NULL)
return;
tvhtrace("descrambler", "mux %p - flush tables", mux);
#if ENABLE_CWC
cwc_caid_update(mux, 0, 0, -1);
#endif
pthread_mutex_lock(&mux->mm_descrambler_lock);
while ((dt = TAILQ_FIRST(&mux->mm_descrambler_tables)) != NULL) {
while ((ds = TAILQ_FIRST(&dt->sections)) != NULL) {
Expand Down

0 comments on commit c1166d7

Please sign in to comment.