Skip to content

Commit

Permalink
Remove PI from PMT and compose it instead using caid/capid
Browse files Browse the repository at this point in the history
  • Loading branch information
Catalin Toda committed Jun 6, 2021
1 parent 76e53d1 commit 26b425b
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 85 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The latest binaries for embedded platforms: https://minisatip.org/forum/viewtopi

Contact
-------
Please use https://minisatip.org/forum/ for any questions.
Please use https://minisatip.org/forum/ for any question or join slack: https://join.slack.com/t/minisatip/shared_invite/zt-rms717g0-SQR25SFs8RH9JlVZV4II7A

In order to speed up the investigation of an issue, please provide the full log and a link to the application that is not working.

Expand All @@ -31,11 +31,11 @@ https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=7UWQ7FXSABUH8&item
Usage:
-------

minisatip version 1.0.4-da99a96, compiled in Feb 3 2021 16:35:57, with s2api version: 050B
minisatip version v1.1.6-76e53d1, compiled in Jun 4 2021 16:58:12, with s2api version: 050B

./minisatip [-[fgtzE]] [-a x:y:z] [-b X:Y] [-B X] [-H X:Y] [-d A:C-U ] [-D device_id] [-e X-Y,Z] [-i prio]
[-[uj] A1:S1-F1[-PIN]] [-m mac] [-P port] [-l module1[,module2]] [-v module1[,module2]][-o oscam_host:dvbapi_port,offset] [-p public_host] [-r remote_rtp_host] [-R document_root] [-s [*][DELSYS:][FE_ID@][source_ip/]host[:port] [-u A1:S1-F1[-PIN]] [-L A1:low-high-switch] [-w http_server[:port]]
[-x http_port] [-X xml_path] [-y rtsp_port]
[-x http_port] [-X xml_path] [-y rtsp_port] [-I name_service]

Help
-------
Expand All @@ -46,7 +46,7 @@ Help
* eg: -a 1:2:3
- it will report 1 dvb-s2 device, 2 dvb-t2 devices and 3 dvb-c devices

* -A --disable-ssdp disable SSDP announcement
* -G --disable-ssdp disable SSDP announcement

* -b --buffer X:Y : set the app adapter buffer to X Bytes (default: 376000) and set the kernel DVB buffer to Y Bytes (default: 5775360) - both multiple of 188
* eg: -b 18800:18988
Expand Down Expand Up @@ -75,7 +75,7 @@ Help
- note: * as adapter means apply to all adapters

* -E Allows encrypted stream to be sent to the client even if the decrypting is unsuccessful
- note: when pids=all is emulated this pass NULLs too
- note: when pids=all is emulated this pass NULLs too

* -Y --delsys ADAPTER1:DELIVERY_SYSTEM1[,ADAPTER2:DELIVERY_SYSTEM2[,..]] - specify the delivery system of the adapters (0 is the first adapter)
* eg: --delsys 0:dvbt,1:dvbs
Expand All @@ -95,6 +95,8 @@ Help
* -H --threshold X:Y : set the write time threshold to X (UDP) / Y (TCP) milliseconds.
* eg: -H 5:50 - set thresholds to 5ms (UDP) and 50ms (TCP)

* -I --name-app specificies an alternative Service Name

* -i --priority prio: set the DVR thread priority to prio

* -k Emulate pids=all when the hardware does not support it, on enigma boxes is enabled by default
Expand Down
2 changes: 1 addition & 1 deletion readme_header
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The latest binaries for embedded platforms: https://minisatip.org/forum/viewtopi

Contact
-------
Please use https://minisatip.org/forum/ for any questions.
Please use https://minisatip.org/forum/ for any question or join slack: https://join.slack.com/t/minisatip/shared_invite/zt-rms717g0-SQR25SFs8RH9JlVZV4II7A

In order to speed up the investigation of an issue, please provide the full log and a link to the application that is not working.

Expand Down
15 changes: 6 additions & 9 deletions src/dvbapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,7 @@ int dvbapi_send_pmt(SKey *k, int cmd_id) {
copy16(buf, 23, 0x8701); // ca_device_descriptor (caX)
buf[25] = demux;

memcpy(buf + 26, k->pi, k->pi_len); // CA description
len = 26 + k->pi_len;
len = 26 + pmt_add_ca_descriptor(pmt, buf + 26); // CA description

// Pids associated with the PMT
copy16(buf, 10, len - 12);
Expand Down Expand Up @@ -756,15 +755,15 @@ int keys_del(int i) {
}
if (!ek) {
buf[7] = 0xFF;
msg = "ALL";
msg = "ALL";
TEST_WRITE(write(sock, buf, sizeof(buf)), sizeof(buf));
} else if (!ed) {
buf[7] = k->demux_index;
msg = "DEMUX";
msg = "DEMUX";
TEST_WRITE(write(sock, buf, sizeof(buf)), sizeof(buf));
} else { // only local socket mode where multiple channels are connected to
// the same demux
msg = "PMT";
msg = "PMT";
dvbapi_send_pmt(k, CMD_ID_NOT_SELECTED);
}

Expand All @@ -785,8 +784,8 @@ int keys_del(int i) {
k->hops = k->caid = k->info_pid = k->prid = k->ecmtime = 0;
dvbapi_last_close = getTick();

LOG("Stopped key %d, active keys %d, sock %d, pmt pid %d, sid %04X, op %s", i, ek,
sock, pmt_pid, sid, msg);
LOG("Stopped key %d, active keys %d, sock %d, pmt pid %d, sid %04X, op %s",
i, ek, sock, pmt_pid, sid, msg);

mutex_destroy(&k->mutex);

Expand All @@ -813,8 +812,6 @@ int dvbapi_add_pmt(adapter *ad, SPMT *pmt) {
LOG_AND_RETURN(1, "Could not add key for pmt %d", pmt->id);
mutex_lock(&k->mutex);
pmt->opaque = k;
k->pi_len = pmt->pi_len;
k->pi = pmt->pi;
k->sid = pmt->sid;
k->adapter = ad->id;
k->pmt_pid = pid;
Expand Down
3 changes: 1 addition & 2 deletions src/dvbapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ typedef struct struct_key {
int ver;
int ecms;
int program_id; // pmt sid
unsigned char *pi, cardsystem[64], reader[64], from[64], protocol[64];
int pi_len;
unsigned char cardsystem[64], reader[64], from[64], protocol[64];
int parity;
int blen;
int tsid, onid;
Expand Down
Loading

0 comments on commit 26b425b

Please sign in to comment.