From: Jaroslav Kysela Date: Wed, 30 Dec 2015 20:41:35 +0000 (+0100) Subject: timeshift: do not use wrong pkt pointer after shallow copy X-Git-Tag: v4.2.1~1262 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebf0e1906ed4eeb171018ce8085796fcfef95d95;p=thirdparty%2Ftvheadend.git timeshift: do not use wrong pkt pointer after shallow copy --- diff --git a/src/timeshift.c b/src/timeshift.c index 23f397d1f..5d0a85993 100644 --- a/src/timeshift.c +++ b/src/timeshift.c @@ -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 */ @@ -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));