Skip to content

Commit

Permalink
- Correct identing in ccextractor.c
Browse files Browse the repository at this point in the history
- Correct return code for multiprogram transport streams
  • Loading branch information
cfsmp3 committed Jan 19, 2017
1 parent bc1e309 commit 57daaf3
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 61 deletions.
116 changes: 57 additions & 59 deletions src/ccextractor.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,72 +316,70 @@ int main(int argc, char *argv[])
}
#endif //ENABLE_SHARING

if (dec_ctx->total_pulldownframes)
mprint ("incl. pulldown frames: %s (%u frames at %.2ffps)\n",
print_mstime_static( (LLONG)(dec_ctx->total_pulldownframes*1000/current_fps) ),
dec_ctx->total_pulldownframes, current_fps);
if (dec_ctx->timing->pts_set >= 1 && dec_ctx->timing->min_pts != 0x01FFFFFFFFLL)
{
LLONG postsyncms = (LLONG) (dec_ctx->frames_since_last_gop*1000/current_fps);
mprint ("\nMin PTS: %s\n",
print_mstime_static( dec_ctx->timing->min_pts/(MPEG_CLOCK_FREQ/1000) - dec_ctx->timing->fts_offset));
if (pts_big_change)
mprint ("(Reference clock was reset at some point, Min PTS is approximated)\n");
mprint ("Max PTS: %s\n",
print_mstime_static( dec_ctx->timing->sync_pts/(MPEG_CLOCK_FREQ/1000) + postsyncms));

mprint ("Length: %s\n",
print_mstime_static( dec_ctx->timing->sync_pts/(MPEG_CLOCK_FREQ/1000) + postsyncms
- dec_ctx->timing->min_pts/(MPEG_CLOCK_FREQ/1000) + dec_ctx->timing->fts_offset ));
}
if (dec_ctx->total_pulldownframes)
mprint ("incl. pulldown frames: %s (%u frames at %.2ffps)\n",
print_mstime_static( (LLONG)(dec_ctx->total_pulldownframes*1000/current_fps) ),
dec_ctx->total_pulldownframes, current_fps);
if (dec_ctx->timing->pts_set >= 1 && dec_ctx->timing->min_pts != 0x01FFFFFFFFLL)
{
LLONG postsyncms = (LLONG) (dec_ctx->frames_since_last_gop*1000/current_fps);
mprint ("\nMin PTS: %s\n",
print_mstime_static( dec_ctx->timing->min_pts/(MPEG_CLOCK_FREQ/1000) - dec_ctx->timing->fts_offset));
if (pts_big_change)
mprint ("(Reference clock was reset at some point, Min PTS is approximated)\n");
mprint ("Max PTS: %s\n",
print_mstime_static( dec_ctx->timing->sync_pts/(MPEG_CLOCK_FREQ/1000) + postsyncms));

mprint ("Length: %s\n",
print_mstime_static( dec_ctx->timing->sync_pts/(MPEG_CLOCK_FREQ/1000) + postsyncms
- dec_ctx->timing->min_pts/(MPEG_CLOCK_FREQ/1000) + dec_ctx->timing->fts_offset ));
}


// dvr-ms files have invalid GOPs
if (gop_time.inited && first_gop_time.inited && stream_mode != CCX_SM_ASF)
{
mprint ("\nInitial GOP time: %s\n",
print_mstime_static(first_gop_time.ms));
mprint ("Final GOP time: %s%+3dF\n",
print_mstime_static(gop_time.ms),
dec_ctx->frames_since_last_gop);
mprint ("Diff. GOP length: %s%+3dF",
print_mstime_static(gop_time.ms - first_gop_time.ms),
dec_ctx->frames_since_last_gop);
mprint (" (%s)\n\n",
print_mstime_static(gop_time.ms - first_gop_time.ms
+(LLONG) ((dec_ctx->frames_since_last_gop)*1000/29.97)) );
}
// dvr-ms files have invalid GOPs
if (gop_time.inited && first_gop_time.inited && stream_mode != CCX_SM_ASF)
{
mprint ("\nInitial GOP time: %s\n",
print_mstime_static(first_gop_time.ms));
mprint ("Final GOP time: %s%+3dF\n",
print_mstime_static(gop_time.ms),
dec_ctx->frames_since_last_gop);
mprint ("Diff. GOP length: %s%+3dF",
print_mstime_static(gop_time.ms - first_gop_time.ms),
dec_ctx->frames_since_last_gop);
mprint (" (%s)\n\n",
print_mstime_static(gop_time.ms - first_gop_time.ms
+(LLONG) ((dec_ctx->frames_since_last_gop)*1000/29.97)) );
}

if (dec_ctx->false_pict_header)
mprint ("\nNumber of likely false picture headers (discarded): %d\n",dec_ctx->false_pict_header);

if (dec_ctx->stat_numuserheaders)
mprint("\nTotal user data fields: %d\n", dec_ctx->stat_numuserheaders);
if (dec_ctx->stat_dvdccheaders)
mprint("DVD-type user data fields: %d\n", dec_ctx->stat_dvdccheaders);
if (dec_ctx->stat_scte20ccheaders)
mprint("SCTE-20 type user data fields: %d\n", dec_ctx->stat_scte20ccheaders);
if (dec_ctx->stat_replay4000headers)
mprint("ReplayTV 4000 user data fields: %d\n", dec_ctx->stat_replay4000headers);
if (dec_ctx->stat_replay5000headers)
mprint("ReplayTV 5000 user data fields: %d\n", dec_ctx->stat_replay5000headers);
if (dec_ctx->stat_hdtv)
mprint("HDTV type user data fields: %d\n", dec_ctx->stat_hdtv);
if (dec_ctx->stat_dishheaders)
mprint("Dish Network user data fields: %d\n", dec_ctx->stat_dishheaders);
if (dec_ctx->stat_divicom)
{
mprint("CEA608/Divicom user data fields: %d\n", dec_ctx->stat_divicom);
if (dec_ctx->false_pict_header)
mprint ("\nNumber of likely false picture headers (discarded): %d\n",dec_ctx->false_pict_header);

if (dec_ctx->stat_numuserheaders)
mprint("\nTotal user data fields: %d\n", dec_ctx->stat_numuserheaders);
if (dec_ctx->stat_dvdccheaders)
mprint("DVD-type user data fields: %d\n", dec_ctx->stat_dvdccheaders);
if (dec_ctx->stat_scte20ccheaders)
mprint("SCTE-20 type user data fields: %d\n", dec_ctx->stat_scte20ccheaders);
if (dec_ctx->stat_replay4000headers)
mprint("ReplayTV 4000 user data fields: %d\n", dec_ctx->stat_replay4000headers);
if (dec_ctx->stat_replay5000headers)
mprint("ReplayTV 5000 user data fields: %d\n", dec_ctx->stat_replay5000headers);
if (dec_ctx->stat_hdtv)
mprint("HDTV type user data fields: %d\n", dec_ctx->stat_hdtv);
if (dec_ctx->stat_dishheaders)
mprint("Dish Network user data fields: %d\n", dec_ctx->stat_dishheaders);
if (dec_ctx->stat_divicom)
{
mprint("CEA608/Divicom user data fields: %d\n", dec_ctx->stat_divicom);

mprint("\n\nNOTE! The CEA 608 / Divicom standard encoding for closed\n");
mprint("caption is not well understood!\n\n");
mprint("Please submit samples to the developers.\n\n\n");
}
mprint("\n\nNOTE! The CEA 608 / Divicom standard encoding for closed\n");
mprint("caption is not well understood!\n\n");
mprint("Please submit samples to the developers.\n\n\n");
}

}



if(is_decoder_processed_enough(ctx) == CCX_TRUE)
break;
} // file loop
Expand Down
8 changes: 6 additions & 2 deletions src/lib_ccx/general_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ int end_of_file=0; // End of file?

const static unsigned char DO_NOTHING[] = {0x80, 0x80};


// Program stream specific data grabber
int ps_get_more_data(struct lib_ccx_ctx *ctx, struct demuxer_data ** ppdata)
{
Expand Down Expand Up @@ -1037,7 +1036,9 @@ int general_loop(struct lib_ccx_ctx *ctx)
if(data_node->pts != CCX_NOPTS)
set_current_pts(dec_ctx->timing, data_node->pts);

process_data(enc_ctx, dec_ctx, data_node);
ret = process_data(enc_ctx, dec_ctx, data_node);
if (enc_ctx->srt_counter || enc_ctx->cea_708_counter || dec_ctx->saw_caption_block || ret == 1)
caps = 1;
}
if (!data_node)
continue;
Expand Down Expand Up @@ -1068,13 +1069,16 @@ int general_loop(struct lib_ccx_ctx *ctx)
}
}
}

//void segment_output_file(struct lib_ccx_ctx *ctx, struct lib_cc_decode *dec_ctx);
segment_output_file(ctx, dec_ctx);

if (ccx_options.send_to_srv)
net_check_conn();
}
list_for_each_entry(dec_ctx, &ctx->dec_ctx_head, list, struct lib_cc_decode)
{

if (dec_ctx->codec == CCX_CODEC_TELETEXT)
telxcc_close(&dec_ctx->private_data, &dec_ctx->dec_sub);
// Flush remaining HD captions
Expand Down

0 comments on commit 57daaf3

Please sign in to comment.