diff --git a/src/lib_ccx/ccx_common_option.c b/src/lib_ccx/ccx_common_option.c index 75285b13..d9f7d5c7 100644 --- a/src/lib_ccx/ccx_common_option.c +++ b/src/lib_ccx/ccx_common_option.c @@ -62,6 +62,7 @@ void init_options (struct ccx_s_options *options) options->xmltv=0; // 1 = full output. 2 = live output. 3 = both options->xmltvliveinterval=10; // interval in seconds between writting xmltv output files in live mode options->xmltvoutputinterval=0; // interval in seconds between writting xmltv full file output + options->xmltvonlycurrent=0; // 0 off 1 on options->teletext_mode=CCX_TXT_AUTO_NOT_YET_FOUND; // 0=Disabled, 1 = Not found, 2=Found options->transcript_settings = ccx_encoders_default_transcript_settings; diff --git a/src/lib_ccx/ccx_common_option.h b/src/lib_ccx/ccx_common_option.h index 29d0345a..ee72947b 100644 --- a/src/lib_ccx/ccx_common_option.h +++ b/src/lib_ccx/ccx_common_option.h @@ -56,6 +56,7 @@ struct ccx_s_options // Options from user parameters int xmltv; // 1 = full output. 2 = live output. 3 = both int xmltvliveinterval; // interval in seconds between writting xmltv output files in live mode int xmltvoutputinterval; // interval in seconds between writting xmltv full file output + int xmltvonlycurrent; // 0 off 1 on unsigned teletext_mode; // 0=Disabled, 1 = Not found, 2=Found ccx_encoders_transcript_format transcript_settings; // Keeps the settings for generating transcript output files. char millis_separator; diff --git a/src/lib_ccx/params.c b/src/lib_ccx/params.c index b48d7b44..d59d4eef 100644 --- a/src/lib_ccx/params.c +++ b/src/lib_ccx/params.c @@ -1513,6 +1513,12 @@ void parse_parameters (struct ccx_s_options *opt, int argc, char *argv[]) } continue; } + if (strcmp (argv[i],"-xmltvonlycurrent")==0) + { + ccx_options.xmltvonlycurrent=1; + i++; + continue; + } if (strcmp (argv[i],"-unixts")==0 && ibasefilename) + 9); memcpy(filename, ctx->basefilename, strlen(ctx->basefilename)+1); strcat(filename, "_epg.xml"); @@ -239,14 +239,25 @@ void EPG_output(struct lib_ccx_ctx *ctx) { fprintf(f, " %i\n", pmt_array[i].program_number); fprintf(f, " \n"); } - for(i=0; ieit_programs[i].array_len; j++) - EPG_print_event(&ctx->eit_programs[i].epg_events[j], pmt_array[i].program_number, f); - } + if(ccx_options.xmltvonlycurrent==0) { // print all events + for(i=0; ieit_programs[i].array_len; j++) + EPG_print_event(&ctx->eit_programs[i].epg_events[j], pmt_array[i].program_number, f); + } - if(pmt_array_length==0) //Stream has no PMT, fall back to unordered events - for(j=0; jeit_programs[TS_PMT_MAP_SIZE].array_len; j++) - EPG_print_event(&ctx->eit_programs[TS_PMT_MAP_SIZE].epg_events[j], ctx->eit_programs[TS_PMT_MAP_SIZE].epg_events[j].service_id, f); + if(pmt_array_length==0) //Stream has no PMT, fall back to unordered events + for(j=0; jeit_programs[TS_PMT_MAP_SIZE].array_len; j++) + EPG_print_event(&ctx->eit_programs[TS_PMT_MAP_SIZE].epg_events[j], ctx->eit_programs[TS_PMT_MAP_SIZE].epg_events[j].service_id, f); + } + else { // print current events only + for(i=0; ieit_current_events[i]; + for(j=0; jeit_programs[i].array_len; j++) { + if(ce==ctx->eit_programs[i].epg_events[j].id) + EPG_print_event(&ctx->eit_programs[i].epg_events[j], pmt_array[i].program_number, f); + } + } + } fprintf(f, ""); fclose(f); }