From: Andreas Ă–man Date: Tue, 20 Nov 2007 08:14:11 +0000 (+0000) Subject: only put packet on storage queue if we actually stored it X-Git-Tag: 2.12~1389 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=268f5f028cbe9e554635d1ff09528eaa81fceaff;p=thirdparty%2Ftvheadend.git only put packet on storage queue if we actually stored it --- diff --git a/buffer.c b/buffer.c index 247b0e92e..a33c46d89 100644 --- a/buffer.c +++ b/buffer.c @@ -294,9 +294,6 @@ storage_disk_enq(th_pkt_t *pkt) char fbuf[500]; int fd; - TAILQ_INSERT_TAIL(&store_disk_queue, pkt, pkt_disk_link); - store_disk_size += pkt->pkt_payloadlen; - if(curstore == NULL) { snprintf(fbuf, sizeof(fbuf), "%s/s%d", store_path, ++store_tally); @@ -315,6 +312,9 @@ storage_disk_enq(th_pkt_t *pkt) if(s != NULL) { + TAILQ_INSERT_TAIL(&store_disk_queue, pkt, pkt_disk_link); + store_disk_size += pkt->pkt_payloadlen; + s->ts_refcount++; pkt->pkt_storage = s; pkt->pkt_storage_offset = s->ts_offset;