-
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
… and only CAIDs accepted by the CAM
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -280,6 +280,34 @@ void disable_cws_for_all_pmts(ca_device_t *d) { | |
} | ||
} | ||
|
||
int CAPMT_add_PMT(uint8_t *capmt, int len, SPMT *pmt, int cmd_id, | ||
int added_only, int ca_id) { | ||
int i = 0, pos = 0; | ||
for (i = 0; i < pmt->stream_pids; i++) { | ||
if (added_only && !find_pid(pmt->adapter, pmt->stream_pid[i].pid)) { | ||
LOGM("%s: skipping pmt %d (ad %d) pid %d from CAPMT", __FUNCTION__, | ||
pmt->id, pmt->adapter, pmt->stream_pid[i].pid); | ||
continue; | ||
} | ||
if (!pmt->stream_pid[i].is_audio && !pmt->stream_pid[i].is_video) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Jalle19
Collaborator
|
||
continue; | ||
capmt[pos++] = pmt->stream_pid[i].type; | ||
copy16(capmt, pos, pmt->stream_pid[i].pid); | ||
pos += 2; | ||
int pi_len_pos = pos, pi_len = 0; | ||
pos += 2; | ||
|
||
// append the stream descriptors | ||
if (pmt->caids) { | ||
capmt[pos++] = cmd_id; | ||
pi_len = pmt_add_ca_descriptor(pmt, capmt + pos, ca_id); | ||
pos += pi_len; | ||
} | ||
copy16(capmt, pi_len_pos, pi_len + 1); | ||
} | ||
return pos; | ||
} | ||
|
||
int create_capmt(SCAPMT *ca, int listmgmt, uint8_t *capmt, int capmt_len, | ||
int cmd_id, int added_only) { | ||
int pos = 0; | ||
|
@@ -297,10 +325,11 @@ int create_capmt(SCAPMT *ca, int listmgmt, uint8_t *capmt, int capmt_len, | |
capmt[pos++] = 0; // PI LEN 2 bytes, set 0 | ||
capmt[pos++] = 0; | ||
|
||
pos += CAPMT_add_PMT(capmt + pos, capmt_len - pos, pmt, cmd_id, added_only); | ||
pos += CAPMT_add_PMT(capmt + pos, capmt_len - pos, pmt, cmd_id, added_only, | ||
dvbca_id); | ||
if (other) { | ||
pos += CAPMT_add_PMT(capmt + pos, capmt_len - pos, other, cmd_id, | ||
added_only); | ||
added_only, dvbca_id); | ||
} | ||
|
||
return pos; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2313,10 +2313,16 @@ int pmt_tune(adapter *ad) { | |
return 0; | ||
} | ||
|
||
int pmt_add_ca_descriptor(SPMT *pmt, uint8_t *buf) { | ||
int pmt_add_ca_descriptor(SPMT *pmt, uint8_t *buf, int ca_id) { | ||
int i, len = 0; | ||
for (i = 0; i < pmt->caids; i++) { | ||
int private_data_len = pmt->ca[i].private_data_len; | ||
#ifndef DISABLE_TABLES | ||
This comment has been minimized.
Sorry, something went wrong.
Jalle19
Collaborator
|
||
if (!match_ca_caid(ca_id, pmt->adapter, pmt->ca[i].id)){ | ||
LOGM("SCA %d cannot handle CAID %04X, skipping", ca_id, pmt->ca[i].id); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
continue; | ||
} | ||
#endif | ||
int private_data_len = pmt->ca[i].private_data_len; | ||
buf[len] = 0x09; | ||
buf[len + 1] = 0x04 + private_data_len; | ||
copy16(buf, len + 2, pmt->ca[i].id); | ||
|
@@ -2329,32 +2335,6 @@ int pmt_add_ca_descriptor(SPMT *pmt, uint8_t *buf) { | |
return len; | ||
} | ||
|
||
int CAPMT_add_PMT(uint8_t *capmt, int len, SPMT *pmt, int cmd_id, | ||
int added_only) { | ||
int i = 0, pos = 0; | ||
for (i = 0; i < pmt->stream_pids; i++) { | ||
if (added_only && !find_pid(pmt->adapter, pmt->stream_pid[i].pid)) { | ||
LOGM("%s: skipping pmt %d (ad %d) pid %d from CAPMT", __FUNCTION__, | ||
pmt->id, pmt->adapter, pmt->stream_pid[i].pid); | ||
continue; | ||
} | ||
capmt[pos++] = pmt->stream_pid[i].type; | ||
copy16(capmt, pos, pmt->stream_pid[i].pid); | ||
pos += 2; | ||
int pi_len_pos = pos, pi_len = 0; | ||
pos += 2; | ||
|
||
// append the stream descriptors | ||
if (pmt->caids) { | ||
capmt[pos++] = cmd_id; | ||
pi_len = pmt_add_ca_descriptor(pmt, capmt + pos); | ||
pos += pi_len; | ||
} | ||
copy16(capmt, pi_len_pos, pi_len + 1); | ||
} | ||
return pos; | ||
} | ||
|
||
char *get_channel_for_adapter(int aid, char *dest, int max_size) { | ||
int i, pos = 0; | ||
adapter *ad; | ||
|
I think we have a bug somewhere that causes
is_audio
to sometimes be false even for audio streams, leading to missing audio.