mirror of
https://github.com/rofafor/vdr-plugin-iptv.git
synced 2023-10-10 13:37:03 +02:00
Modified pid scanner timeout to 15s.
This commit is contained in:
parent
4188a5d4e2
commit
554bc5cb41
18
pidscanner.c
18
pidscanner.c
@ -3,16 +3,16 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: pidscanner.c,v 1.5 2008/02/02 20:51:47 rahrenbe Exp $
|
* $Id: pidscanner.c,v 1.6 2008/02/02 21:06:14 rahrenbe Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "pidscanner.h"
|
#include "pidscanner.h"
|
||||||
|
|
||||||
#define PIDSCANNER_TIMEOUT_IN_MS 60000 /* 60s */
|
#define PIDSCANNER_TIMEOUT_IN_MS 15000 /* 15s timeout for detection */
|
||||||
#define NR_APIDS 5
|
#define PIDSCANNER_APID_COUNT 5 /* minimum count of audio pid samples for pid detection */
|
||||||
#define NR_VPIDS 10
|
#define PIDSCANNER_VPID_COUNT 10 /* minimum count of video pid samples for pid detection */
|
||||||
#define NR_PID_DELTA 50
|
#define PIDSCANNER_PID_DELTA_COUNT 50 /* minimum count of pid samples for audio/video only pid detection */
|
||||||
|
|
||||||
cPidScanner::cPidScanner(void)
|
cPidScanner::cPidScanner(void)
|
||||||
: timeout(0),
|
: timeout(0),
|
||||||
@ -113,8 +113,8 @@ void cPidScanner::Process(const uint8_t* buf)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((numVpids > NR_VPIDS && numApids > NR_APIDS) ||
|
if (((numVpids > PIDSCANNER_VPID_COUNT) && (numApids > PIDSCANNER_APID_COUNT)) ||
|
||||||
abs(numApids - numVpids) > NR_PID_DELTA) {
|
(abs(numApids - numVpids) > PIDSCANNER_PID_DELTA_COUNT)) {
|
||||||
// Lock channels for pid updates
|
// Lock channels for pid updates
|
||||||
if (!Channels.Lock(true, 10)) {
|
if (!Channels.Lock(true, 10)) {
|
||||||
timeout.Set(PIDSCANNER_TIMEOUT_IN_MS);
|
timeout.Set(PIDSCANNER_TIMEOUT_IN_MS);
|
||||||
@ -130,9 +130,9 @@ void cPidScanner::Process(const uint8_t* buf)
|
|||||||
int Ppid = IptvChannel->Ppid();
|
int Ppid = IptvChannel->Ppid();
|
||||||
int Tpid = IptvChannel->Tpid();
|
int Tpid = IptvChannel->Tpid();
|
||||||
bool foundApid = false;
|
bool foundApid = false;
|
||||||
if (numVpids <= NR_VPIDS)
|
if (numVpids <= PIDSCANNER_VPID_COUNT)
|
||||||
Vpid = 0; // No detected video pid
|
Vpid = 0; // No detected video pid
|
||||||
else if (numApids <= NR_APIDS)
|
else if (numApids <= PIDSCANNER_APID_COUNT)
|
||||||
Apid = 0; // No detected audio pid
|
Apid = 0; // No detected audio pid
|
||||||
for (unsigned int i = 1; i < MAXAPIDS; ++i) {
|
for (unsigned int i = 1; i < MAXAPIDS; ++i) {
|
||||||
Apids[i] = IptvChannel->Apid(i);
|
Apids[i] = IptvChannel->Apid(i);
|
||||||
|
Loading…
Reference in New Issue
Block a user