From 0a22e1e429dad2ea2eddfc9b86e58089e8d10d61 Mon Sep 17 00:00:00 2001 From: Brooss Date: Tue, 3 Mar 2015 14:38:19 +1100 Subject: [PATCH] fix crash with -out=null --- src/lib_ccx/ts_tables_epg.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib_ccx/ts_tables_epg.c b/src/lib_ccx/ts_tables_epg.c index 8564ce24..628895b8 100644 --- a/src/lib_ccx/ts_tables_epg.c +++ b/src/lib_ccx/ts_tables_epg.c @@ -151,7 +151,7 @@ void EPG_output_live(struct lib_ccx_ctx *ctx) { if(!c) return; - filename = malloc(strlen(ctx->wbout1.filename)+30); + filename = malloc(strlen(ctx->basefilename)+30); sprintf(filename, "%s_%i.xml.part", ctx->basefilename, ctx->epg_last_live_output); f = fopen(filename, "w"); @@ -184,7 +184,7 @@ void EPG_output(struct lib_ccx_ctx *ctx) { FILE *f; char *filename; int i,j; - filename = malloc(strlen(ctx->wbout1.filename)+9); + filename = malloc(strlen(ctx->basefilename) + 9); memcpy(filename, ctx->basefilename, strlen(ctx->basefilename)+1); strcat(filename, "_epg.xml"); f = fopen(filename, "w"); @@ -716,7 +716,6 @@ void EPG_DVB_decode_EIT(struct lib_ccx_ctx *ctx, uint8_t *payload_start, uint32_ } //handle outputing to xml files void EPG_handle_output(struct lib_ccx_ctx *ctx) { - int cur_sec = (int) ((ctx->global_timestamp-ctx->min_global_timestamp) / 1000); if(ccx_options.xmltv==1 || ccx_options.xmltv==3) { //full outout if(ccx_options.xmltvoutputinterval!=0 && cur_sec>ctx->epg_last_output+ccx_options.xmltvliveinterval) {