Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
timeshift: do not use wrong pkt pointer after shallow copy
  • Loading branch information
perexg committed Dec 30, 2015
1 parent a8695cd commit ebf0e19
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/timeshift.c
Expand Up @@ -349,9 +349,9 @@ static void timeshift_input
if (ts->packet_mode && ts->start_pts && type == SMT_PACKET) {
pkt2 = pkt_copy_shallow(pkt);
pkt_ref_dec(pkt);
sm->sm_data = pkt2;
pkt2->pkt_pts += ts->start_pts;
pkt2->pkt_dts += ts->start_pts;
sm->sm_data = pkt = pkt2;
pkt->pkt_pts += ts->start_pts;
pkt->pkt_dts += ts->start_pts;
}

/* Pass-thru */
Expand All @@ -363,7 +363,8 @@ static void timeshift_input
atomic_add(&ts->smt_start->ss_refcount, 1);
if (ts->packet_mode) {
timeshift_packet_flush(ts, ts->last_time + MAX_TIME_DELTA + 1000);
ts->start_pts = ts->last_time + 1000;
if (ts->last_time)
ts->start_pts = ts->last_time + 1000;
}
}
streaming_target_deliver2(ts->output, streaming_msg_clone(sm));
Expand Down

0 comments on commit ebf0e19

Please sign in to comment.