void dinit_libraries( struct lib_ccx_ctx **ctx) { struct lib_ccx_ctx *lctx = *ctx; struct encoder_ctx *enc_ctx; struct lib_cc_decode *dec_ctx; struct lib_cc_decode *dec_ctx1; int i; list_for_each_entry_safe(dec_ctx, dec_ctx1, &lctx->dec_ctx_head, list, struct lib_cc_decode) { LLONG cfts; if (dec_ctx->codec == CCX_CODEC_DVB) dvbsub_close_decoder(&dec_ctx->private_data); //Test memory for teletext else if (dec_ctx->codec == CCX_CODEC_TELETEXT) telxcc_close(&dec_ctx->private_data, &dec_ctx->dec_sub); else if (dec_ctx->codec == CCX_CODEC_ISDB_CC) delete_isdb_decoder(&dec_ctx->private_data); flush_cc_decode(dec_ctx, &dec_ctx->dec_sub); cfts = get_fts(dec_ctx->timing, dec_ctx->current_field); enc_ctx = get_encoder_by_pn(lctx, dec_ctx->program_number); if (enc_ctx && dec_ctx->dec_sub.got_output == CCX_TRUE) { encode_sub(enc_ctx, &dec_ctx->dec_sub); dec_ctx->dec_sub.got_output = CCX_FALSE; } list_del(&dec_ctx->list); dinit_cc_decode(&dec_ctx); if (enc_ctx) { list_del(&enc_ctx->list); dinit_encoder(&enc_ctx, cfts); } } // free EPG memory EPG_free(lctx); freep(&lctx->freport.data_from_608); freep(&lctx->freport.data_from_708); ccx_demuxer_delete(&lctx->demux_ctx); dinit_decoder_setting(&lctx->dec_global_setting); freep(&ccx_options.enc_cfg.output_filename); freep(&lctx->basefilename); freep(&lctx->pesheaderbuf); for(i = 0;i < lctx->num_input_files;i++) freep(&lctx->inputfile[i]); freep(&lctx->inputfile); freep(ctx); }
void dinit_libraries( struct lib_ccx_ctx **ctx) { struct lib_ccx_ctx *lctx = *ctx; int i = 0; for (i = 0; i < MAX_PID; i++) { if( lctx->PIDs_programs[i]) freep(lctx->PIDs_programs + i); } // free EPG memory EPG_free(lctx); dinit_ts(lctx); dinit_cc_decode(&lctx->dec_ctx); freep(&lctx->basefilename); freep(&lctx->buffer); freep(&lctx->pesheaderbuf); freep(&lctx->freport.data_from_608); freep(ctx); }
void dinit_libraries( struct lib_ccx_ctx **ctx) { struct lib_ccx_ctx *lctx = *ctx; struct encoder_ctx *enc_ctx; struct lib_cc_decode *dec_ctx; struct lib_cc_decode *dec_ctx1; int i; list_for_each_entry_safe(dec_ctx, dec_ctx1, &lctx->dec_ctx_head, list, struct lib_cc_decode) { flush_cc_decode(dec_ctx, &dec_ctx->dec_sub); enc_ctx = get_encoder_by_pn(lctx, dec_ctx->program_number); if (enc_ctx && dec_ctx->dec_sub.got_output == CCX_TRUE) { encode_sub(enc_ctx, &dec_ctx->dec_sub); dec_ctx->dec_sub.got_output = CCX_FALSE; } list_del(&dec_ctx->list); dinit_cc_decode(&dec_ctx); if (enc_ctx) { list_del(&enc_ctx->list); dinit_encoder(&enc_ctx); } } // free EPG memory EPG_free(lctx); freep(&lctx->freport.data_from_608); ccx_demuxer_delete(&lctx->demux_ctx); dinit_decoder_setting(&lctx->dec_global_setting); freep(&ccx_options.enc_cfg.output_filename); freep(&lctx->basefilename); freep(&lctx->pesheaderbuf); for(i = 0;i < lctx->num_input_files;i++) freep(&lctx->inputfile[i]); freep(&lctx->inputfile); freep(ctx); }