Skip to content

Instantly share code, notes, and snippets.

@2GMon
Last active October 26, 2019 07:56
Show Gist options
  • Select an option

  • Save 2GMon/3621dd5054ab20c2a8c565fc236de093 to your computer and use it in GitHub Desktop.

Select an option

Save 2GMon/3621dd5054ab20c2a8c565fc236de093 to your computer and use it in GitHub Desktop.
PT3環境でmirakurun と http://www13.plala.or.jp/sat/recdvb/recdvb-1.3.1.tgz の組み合わせでEPGが取得できない問題に対する修正
--- recpt1.c.orig 2019-09-22 18:18:28.164084939 +0900
+++ recpt1.c 2019-09-22 18:23:46.901127087 +0900
@@ -51,23 +51,23 @@
char *channel;
int tsid;
} preset_ch[NUM_PRESET_CH] = {
- { 101, "bs15", 0x40f1 }, { 103, "bs03", 0x4031 },
- { 141, "bs13", 0x40d0 }, { 151, "bs01", 0x4010 },
- { 161, "bs01", 0x4011 }, { 171, "bs01", 0x4012 },
- { 181, "bs13", 0x40d1 }, { 191, "bs03", 0x4030 },
- { 192, "bs05", 0x4450 }, { 193, "bs05", 0x4451 },
- { 200, "bs09", 0x4091 }, { 201, "bs15", 0x40f2 },
- { 202, "bs15", 0x40f2 }, { 211, "bs09", 0x4490 },
- { 222, "bs09", 0x4092 }, { 231, "bs11", 0x46b2 },
- { 232, "bs11", 0x46b2 }, { 233, "bs11", 0x46b2 },
- { 234, "bs19", 0x4730 }, { 236, "bs13", 0x46d2 },
- { 238, "bs11", 0x46b0 }, { 241, "bs11", 0x46b1 },
- { 242, "bs19", 0x4731 }, { 243, "bs19", 0x4732 },
- { 244, "bs21", 0x4751 }, { 245, "bs21", 0x4752 },
- { 251, "bs23", 0x4770 }, { 252, "bs21", 0x4750 },
- { 255, "bs23", 0x4771 }, { 256, "bs03", 0x4632 },
- { 258, "bs23", 0x4772 }, { 531, "bs11", 0x46b2 },
- { 910, "bs15", 0x40f2 }, { 929, "bs15", 0x40f1 },
+ { 101, "bs15_0", 0x40f1 }, { 103, "bs03_1", 0x4031 },
+ { 141, "bs13_0", 0x40d0 }, { 151, "bs01_0", 0x4010 },
+ { 161, "bs01_1", 0x4011 }, { 171, "bs01_2", 0x4012 },
+ { 181, "bs13_1", 0x40d1 }, { 191, "bs03_0", 0x4030 },
+ { 192, "bs05_0", 0x4450 }, { 193, "bs05_1", 0x4451 },
+ { 200, "bs09_1", 0x4091 }, { 201, "bs15_2", 0x40f2 },
+ { 202, "bs15_2", 0x40f2 }, { 211, "bs09_0", 0x4090 },
+ { 222, "bs09_2", 0x4092 }, { 231, "bs11_2", 0x46b2 },
+ { 232, "bs11_2", 0x46b2 }, { 233, "bs11_2", 0x46b2 },
+ { 234, "bs19_0", 0x4730 }, { 236, "bs13_2", 0x46d2 },
+ { 238, "bs11_0", 0x46b0 }, { 241, "bs11_1", 0x46b1 },
+ { 242, "bs19_1", 0x4731 }, { 243, "bs19_2", 0x4732 },
+ { 244, "bs21_1", 0x4751 }, { 245, "bs21_2", 0x4752 },
+ { 251, "bs23_0", 0x4770 }, { 252, "bs21_0", 0x4750 },
+ { 255, "bs23_1", 0x4771 }, { 256, "bs03_2", 0x4632 },
+ { 258, "bs23_2", 0x4772 }, { 531, "bs11_0", 0x46b2 },
+ { 910, "bs15_0", 0x40f2 }, { 929, "bs15_0", 0x40f1 },
{ 296, "nd02", 0x6020 }, { 298, "nd02", 0x6020 },
{ 299, "nd02", 0x6020 }, { 100, "nd04", 0x7040 },
{ 223, "nd04", 0x7040 }, { 227, "nd04", 0x7040 },
@@ -110,6 +110,33 @@
}
}
+void set_bs_tsid(char *pch, unsigned int *tsid)
+{
+ int i;
+ char channel[8];
+ if (((pch[0] == 'b')|| (pch[0] == 'B')) && ((pch[1] == 's') || (pch[1] == 'S'))) {
+ channel[0] = 'b';
+ channel[1] = 's';
+ } else {
+ *tsid = 0;
+ return;
+ }
+ for (i = 2; pch[i] != '\0'; i++) {
+ channel[i] = pch[i];
+ }
+ pch[i] = '\0';
+
+ for (i = 0; i < NUM_PRESET_CH; i++)
+ if (strcmp(preset_ch[i].channel, channel) == 0) break;
+
+ if (i == NUM_PRESET_CH) {
+ *tsid = 0;
+ } else {
+ *tsid = preset_ch[i].tsid;
+ fprintf(stderr, "tsid = 0x%04x\n", *tsid);
+ }
+}
+
//read 1st line from socket
void read_line(int socket, char *p){
@@ -868,6 +895,7 @@
fprintf(stderr, "tsid = 0x%x\n", tsid);
}
if(pch == NULL) pch = argv[optind];
+ if(!tsid) set_bs_tsid(pch, &tsid);
/* tune */
if(tune(pch, &tdata, dev_num, tsid) != 0)
@o-kawara

o-kawara commented Apr 8, 2017

Copy link
Copy Markdown

当パッチに助けていただきましたが、TSIDの一部に誤りを見つけました。
30行目の { 211, "bs09_0", 0x4490 } の箇所は正しくは { 211, "bs09_0", 0x4090 } のようです。
手元の環境で試してみたところ、BS11がこれで映るようになったことを確認しました。

@2GMon

2GMon commented Jul 9, 2018

Copy link
Copy Markdown
Author

ありがとうございます。修正しました
2018年5月のBSジャパン、BSプレミアムの変更も反映させました

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment