getting ait after starting playback

This commit is contained in:
TangoCash
2021-09-25 19:39:22 +02:00
committed by Thilo Graf
parent 7b4a536f62
commit 4009bd2a68
4 changed files with 17 additions and 13 deletions

View File

@@ -50,8 +50,9 @@ private:
bool Read(); bool Read();
public: public:
CAit(int dnum = 0); CAit();
~CAit(); ~CAit();
void setDemux(int dnum = 0);
bool Start(); bool Start();
bool Stop(); bool Stop();
bool Parse(); bool Parse();

View File

@@ -19,6 +19,7 @@
#include <zapit/bouquets.h> #include <zapit/bouquets.h>
#include <zapit/femanager.h> #include <zapit/femanager.h>
#include <zapit/fastscan.h> #include <zapit/fastscan.h>
#include <zapit/scanait.h>
#define PAL 0 #define PAL 0
#define NTSC 1 #define NTSC 1
@@ -167,7 +168,7 @@ class CZapit : public OpenThreads::Thread
t_channel_id lastChannelTV; t_channel_id lastChannelTV;
int abort_zapit; int abort_zapit;
int pmt_update_fd; int pmt_update_fd;
CAit *ait;
//void LoadAudioMap(); //void LoadAudioMap();
void SaveAudioMap(); void SaveAudioMap();
void SaveVolumeMap(); void SaveVolumeMap();

View File

@@ -37,10 +37,15 @@
#define DEBUG_AIT_UNUSED #define DEBUG_AIT_UNUSED
#define DEBUG_LCN #define DEBUG_LCN
CAit::CAit(int dnum) CAit::CAit()
{
dmxnum = 0;
pid = 0;
}
void CAit::setDemux(int dnum)
{ {
dmxnum = dnum; dmxnum = dnum;
pid = 0;
} }
bool CAit::Start() bool CAit::Start()
@@ -222,6 +227,7 @@ bool CAit::Parse()
} }
if (pFile) if (pFile)
fclose(pFile); fclose(pFile);
sections.clear();
return true; return true;
} }
@@ -232,8 +238,7 @@ bool CAit::Parse(CZapitChannel * const channel)
unlink("/tmp/ait.txt"); unlink("/tmp/ait.txt");
if(pid > 0) if(pid > 0)
{ {
Parse(); return Start();
return true;
} }
return false; return false;
} }

View File

@@ -45,7 +45,6 @@
#include <zapit/getservices.h> #include <zapit/getservices.h>
#include <zapit/pat.h> #include <zapit/pat.h>
#include <zapit/scanpmt.h> #include <zapit/scanpmt.h>
#include <zapit/scanait.h>
#include <zapit/scan.h> #include <zapit/scan.h>
//#include <zapit/fastscan.h> //#include <zapit/fastscan.h>
#include <zapit/scansdt.h> #include <zapit/scansdt.h>
@@ -142,6 +141,7 @@ CZapit::CZapit()
pip_channel_id = 0; pip_channel_id = 0;
lock_channel_id = 0; lock_channel_id = 0;
pip_fe = NULL; pip_fe = NULL;
ait = new CAit();
} }
CZapit::~CZapit() CZapit::~CZapit()
@@ -490,7 +490,6 @@ bool CZapit::ParsePatPmt(CZapitChannel * channel)
CPat pat(channel->getRecordDemux()); CPat pat(channel->getRecordDemux());
CPmt pmt(channel->getRecordDemux()); CPmt pmt(channel->getRecordDemux());
CAit ait(channel->getRecordDemux());
DBG("looking up pids for channel_id " PRINTF_CHANNEL_ID_TYPE "\n", channel->getChannelID()); DBG("looking up pids for channel_id " PRINTF_CHANNEL_ID_TYPE "\n", channel->getChannelID());
if(!pat.Parse(channel)) { if(!pat.Parse(channel)) {
@@ -501,11 +500,6 @@ bool CZapit::ParsePatPmt(CZapitChannel * channel)
printf("[zapit] pmt parsing failed\n"); printf("[zapit] pmt parsing failed\n");
return false; return false;
} }
if (channel == current_channel)
if(!ait.Parse(channel)) {
printf("[zapit] ait parsing failed\n");
}
return true; return true;
} }
@@ -670,6 +664,9 @@ bool CZapit::ZapIt(const t_channel_id channel_id, bool forupdate, bool startplay
if (update_pmt) if (update_pmt)
pmt_set_update_filter(current_channel, &pmt_update_fd); pmt_set_update_filter(current_channel, &pmt_update_fd);
ait->setDemux(current_channel->getRecordDemux());
ait->Parse(current_channel);
return true; return true;
} }