From: Jaroslav Kysela Date: Wed, 30 Dec 2015 20:02:11 +0000 (+0100) Subject: timeshift: little pkt ref count fix X-Git-Tag: v4.2.1~1264 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4eb07091e775a355850462cdc7e92f6d7ad7c701;p=thirdparty%2Ftvheadend.git timeshift: little pkt ref count fix --- diff --git a/src/timeshift.c b/src/timeshift.c index a0e34d32a..23f397d1f 100644 --- a/src/timeshift.c +++ b/src/timeshift.c @@ -259,10 +259,8 @@ timeshift_packet( timeshift_t *ts, th_pkt_t *pkt ) streaming_message_t *sm; int64_t time; - if (pkt->pkt_componentindex >= TIMESHIFT_BACKLOG_MAX) { - pkt_ref_dec(pkt); + if (pkt->pkt_componentindex >= TIMESHIFT_BACKLOG_MAX) return; - } sm = streaming_msg_create_pkt(pkt); @@ -385,9 +383,7 @@ static void timeshift_input sm->sm_time = ts->last_time; if (type == SMT_PACKET) { timeshift_packet(ts, pkt); - sm->sm_data = NULL; - streaming_msg_free(sm); - goto pktcont; + goto msg_free; } } else { if (ts->ref_time == 0) { @@ -411,9 +407,9 @@ static void timeshift_input pkt->pkt_duration, pktbuf_len(pkt->pkt_payload)); } +msg_free: streaming_msg_free(sm); } -pktcont: /* Exit/Stop */ if (exit) {