mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 15:32:52 +02:00
sectionsd: consider the table_id when inserting events
Signed-off-by: Jacek Jendrzej <crashdvb@googlemail.com>
Origin commit data
------------------
Branch: ni/coolstream
Commit: 5db16ee2ff
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2013-02-05 (Tue, 05 Feb 2013)
------------------
This commit was generated by Migit
This commit is contained in:
committed by
Jacek Jendrzej
parent
0e01a7b32c
commit
c16f636011
@@ -5,7 +5,7 @@
|
|||||||
* Copyright (C) 2001 by fnbrd (fnbrd@gmx.de)
|
* Copyright (C) 2001 by fnbrd (fnbrd@gmx.de)
|
||||||
* Homepage: http://dbox2.elxsi.de
|
* Homepage: http://dbox2.elxsi.de
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008, 2009 Stefan Seyfried
|
* Copyright (C) 2008-2013 Stefan Seyfried
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-2012 CoolStream International Ltd
|
* Copyright (C) 2011-2012 CoolStream International Ltd
|
||||||
*
|
*
|
||||||
@@ -408,9 +408,16 @@ xprintf("addEvent: current %016" PRIx64 " event %016" PRIx64 " running %d messag
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
event_id_t x_key = (*x)->uniqueKey();
|
event_id_t x_key = (*x)->uniqueKey();
|
||||||
/* do we need this check? */
|
|
||||||
if (x_key == e_key)
|
if (x_key == e_key)
|
||||||
continue;
|
{
|
||||||
|
/* the present event has a higher table_id than the new one
|
||||||
|
* => delete and insert the new one */
|
||||||
|
if ((*x)->table_id >= e->table_id)
|
||||||
|
continue;
|
||||||
|
/* else: keep the old event with the lower table_id */
|
||||||
|
unlockEvents();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if ((*x)->times.begin()->startzeit >= end_time)
|
if ((*x)->times.begin()->startzeit >= end_time)
|
||||||
continue;
|
continue;
|
||||||
/* iterating backwards: if the endtime of the stored events
|
/* iterating backwards: if the endtime of the stored events
|
||||||
@@ -418,6 +425,14 @@ xprintf("addEvent: current %016" PRIx64 " event %016" PRIx64 " running %d messag
|
|||||||
* find an identical one => bail out */
|
* find an identical one => bail out */
|
||||||
if ((*x)->times.begin()->startzeit + (long)(*x)->times.begin()->dauer <= start_time)
|
if ((*x)->times.begin()->startzeit + (long)(*x)->times.begin()->dauer <= start_time)
|
||||||
break;
|
break;
|
||||||
|
if ((*x)->table_id < e->table_id)
|
||||||
|
{
|
||||||
|
/* don't add the higher table_id */
|
||||||
|
dprintf("%s: don't replace 0x%016" PRIx64 ".%02x with 0x%016" PRIx64 ".%02x\n",
|
||||||
|
__func__, x_key, (*x)->table_id, e_key, e->table_id);
|
||||||
|
unlockEvents();
|
||||||
|
return;
|
||||||
|
}
|
||||||
/* here we have an overlapping event */
|
/* here we have an overlapping event */
|
||||||
dprintf("%s: delete 0x%016" PRIx64 ".%02x time = 0x%016" PRIx64 ".%02x\n", __func__,
|
dprintf("%s: delete 0x%016" PRIx64 ".%02x time = 0x%016" PRIx64 ".%02x\n", __func__,
|
||||||
x_key, (*x)->table_id, e_key, e->table_id);
|
x_key, (*x)->table_id, e_key, e->table_id);
|
||||||
|
Reference in New Issue
Block a user