case SMT_PACKET:
pkt = sm->sm_data;
- if(pkt->pkt_commercial == COMMERCIAL_YES) {
+ if(pkt->pkt_commercial == COMMERCIAL_YES)
dvr_rec_set_state(de, DVR_RS_COMMERCIAL, 0);
- tsfix_set_comm_skip(de->de_tsfix, comm_skip);
- } else {
+ else
dvr_rec_set_state(de, DVR_RS_RUNNING, 0);
- tsfix_set_comm_skip(de->de_tsfix, 0);
- }
+ if(pkt->pkt_commercial == COMMERCIAL_YES && comm_skip)
+ break;
if(started) {
muxer_write_pkt(de->de_mux, sm->sm_type, sm->sm_data);
sm->sm_data = NULL;
int64_t tfs_dts_epoch;
int64_t tfs_last_dts_in;
- int64_t tfs_drops;
} tfstream_t;
int tf_hasvideo;
int64_t tf_tsref;
time_t tf_start_time;
- int tf_comm_skip;
struct th_pktref_queue tf_ptsq;
/* Subtract the transport wide start offset */
dts = pkt->pkt_dts - tf->tf_tsref;
- /* Subtract dropped packets due to commercial breaks */
- dts -= tfs->tfs_drops;
-
if(tfs->tfs_last_dts_norm == PTS_UNSET) {
if(dts < 0) {
/* Early packet with negative time stamp, drop those */
if(pkt->pkt_dts == PTS_UNSET) {
if(tfs->tfs_last_dts_in == PTS_UNSET) {
- tfs->tfs_drops += pdur;
pkt_ref_dec(pkt);
return;
}
tfs->tfs_last_dts_in, pdur, pkt->pkt_dts);
}
- if(tf->tf_comm_skip && pkt->pkt_commercial == COMMERCIAL_YES) {
- tfs->tfs_drops += pdur;
- pkt_ref_dec(pkt);
- return;
- }
-
tfs->tfs_last_dts_in = pkt->pkt_dts;
compute_pts(tf, tfs, pkt);
}
-/**
- *
- */
-void
-tsfix_set_comm_skip(streaming_target_t *pad, int bool) {
- tsfix_t *tf = (tsfix_t *)pad;
-
- tf->tf_comm_skip = !!bool;
-}
-
-
/**
*
*/
void tsfix_set_start_time(streaming_target_t *pad, time_t start);
-void tsfix_set_comm_skip(streaming_target_t *pad, int bool);
-
void tsfix_destroy(streaming_target_t *gh);