# HG changeset patch # User Yoshiki Yazawa # Date 1265781745 -32400 # Node ID 3fd15032fd3aaba5063be496f1a1fa1598daf80f # Parent 4d201756c59319189138786751a8148df3cf6bcd tweak user interface for sid: - rename --split option as --sid - show all available service IDs along with specified SIDs. diff -r 4d201756c593 -r 3fd15032fd3a recpt1/recpt1.c --- a/recpt1/recpt1.c Wed Feb 10 14:55:03 2010 +0900 +++ b/recpt1/recpt1.c Wed Feb 10 15:02:25 2010 +0900 @@ -485,9 +485,9 @@ show_usage(char *cmd) { #ifdef HAVE_LIBARIB25 - fprintf(stderr, "Usage: \n%s [--b25 [--round N] [--strip] [--EMM]] [--udp [--addr hostname --port portnumber]] [--device devicefile] [--lnb voltage] [--split SID1,SID2] channel rectime destfile\n", cmd); + fprintf(stderr, "Usage: \n%s [--b25 [--round N] [--strip] [--EMM]] [--udp [--addr hostname --port portnumber]] [--device devicefile] [--lnb voltage] [--sid SID1,SID2] channel rectime destfile\n", cmd); #else - fprintf(stderr, "Usage: \n%s [--strip] [--EMM]] [--udp [--addr hostname --port portnumber]] [--device devicefile] [--lnb voltage] [--split SID1,SID2] channel rectime destfile\n", cmd); + fprintf(stderr, "Usage: \n%s [--strip] [--EMM]] [--udp [--addr hostname --port portnumber]] [--device devicefile] [--lnb voltage] [--sid SID1,SID2] channel rectime destfile\n", cmd); #endif fprintf(stderr, "\n"); fprintf(stderr, "Remarks:\n"); @@ -510,7 +510,7 @@ fprintf(stderr, " --port portnumber: Port number to connect\n"); fprintf(stderr, "--device devicefile: Specify devicefile to use\n"); fprintf(stderr, "--lnb voltage: Specify LNB voltage (0, 11, 15)\n"); - fprintf(stderr, "--split SID1,SID2...,SIDN: Specify SID number in CSV format(100,101,102,...)\n"); + fprintf(stderr, "--sid SID1,SID2,...: Specify SID number in CSV format (101,102,...)\n"); fprintf(stderr, "--help: Show this help\n"); fprintf(stderr, "--version: Show version\n"); fprintf(stderr, "--list: Show channel list\n"); @@ -896,7 +896,7 @@ { "help", 0, NULL, 'h'}, { "version", 0, NULL, 'v'}, { "list", 0, NULL, 'l'}, - { "split", 1, NULL, 'i'}, + { "sid", 1, NULL, 'i'}, {0, 0, NULL, 0} /* terminate */ }; @@ -913,7 +913,7 @@ char *voltage[] = {"0V", "11V", "15V"}; char *sid_list = NULL; - while((result = getopt_long(argc, argv, "br:smn:ua:p:d:hvl", + while((result = getopt_long(argc, argv, "br:smn:ua:p:d:hvli:", long_options, &option_index)) != -1) { switch(result) { case 'b': diff -r 4d201756c593 -r 3fd15032fd3a recpt1/tssplitter_lite.c --- a/recpt1/tssplitter_lite.c Wed Feb 10 14:55:03 2010 +0900 +++ b/recpt1/tssplitter_lite.c Wed Feb 10 15:02:25 2010 +0900 @@ -113,10 +113,12 @@ { i++; } +#if 0 for(i=0; sid_list[i] != NULL; i++) { printf("sid_list[%d]=[%s].\n",i, sid_list[i]); } +#endif return sid_list; } @@ -325,16 +327,18 @@ unsigned char* pids, // [out] 出力対象 PID 情報 char** sid_list, // [in] 出力対象サービス ID のリスト unsigned char* pmt_pids, // [out] サービス ID に対応する PMT の PID - int* pmt_drop) // [out] 落とすPMTの数 + int* pmt_drop +) // [out] 落とすPMTの数 { int pos[MAX_PID]; int service_id; - int i; + int i, j=0, k; int size = 0; int pid; int result = TSS_SUCCESS; char **p; int sid_found; + int avail_sids[MAX_SERVICES]; if (NULL == *pat) { @@ -350,6 +354,7 @@ { sid_found = 0; service_id = (buf[i] << 8) + buf[i + 1]; + avail_sids[j] = service_id; p = sid_list; while(*p != NULL) { @@ -388,7 +393,21 @@ pos[pid] = i; *(pmt_drop) = *(pmt_drop)+1; } + j++; } + fprintf(stderr, "Available sid = "); + for(k=0; k #include #include - + #pragma warning(disable: 4996) #else #define __STDC_FORMAT_MACROS @@ -32,6 +32,7 @@ #define LENGTH_PACKET (188) #define MAX_PID (8192) +#define MAX_SERVICES (50) #define LENGTH_CRC_DATA (176) #define false (0) #define true (1) @@ -39,7 +40,7 @@ #define TSS_SUCCESS (0) #define TSS_ERROR (-1) #define TSS_NULL (-2) -#define LENGTH_PAT_HEADER (12) +#define LENGTH_PAT_HEADER (12) #define C_CHAR_COMMA ',' /**