eitd/dmx.cpp: delete demux instead of stop in closefd,

add helper to set demux number
This commit is contained in:
[CST] Focus
2013-06-12 18:18:34 +04:00
parent 5ed5b6d200
commit 8bedb877dd
2 changed files with 8 additions and 2 deletions

View File

@@ -117,11 +117,13 @@ void DMX::close(void)
void DMX::closefd(void) void DMX::closefd(void)
{ {
#ifdef DEBUG_DEMUX #ifdef DEBUG_DEMUX
xprintf(" %s: DMX::closefd, isOpen %d\n", name.c_str(), isOpen()); xcprintf(" %s: DMX::closefd, isOpen %d demux #%d", name.c_str(), isOpen(), dmx_num);
#endif #endif
if (isOpen()) if (isOpen())
{ {
dmx->Stop(); //dmx->Stop();
delete dmx;
dmx = NULL;
fd = -1; fd = -1;
} }
} }
@@ -484,6 +486,9 @@ int DMX::immediate_start(void)
} }
if(dmx == NULL) { if(dmx == NULL) {
#ifdef DEBUG_DEMUX
xcprintf(" %s: open demux #%d", name.c_str(), dmx_num);
#endif
dmx = new cDemux(dmx_num); dmx = new cDemux(dmx_num);
dmx->Open(DMX_PSI_CHANNEL, NULL, dmxBufferSizeInKB*1024UL); dmx->Open(DMX_PSI_CHANNEL, NULL, dmxBufferSizeInKB*1024UL);
} }

View File

@@ -126,6 +126,7 @@ public:
unsigned char get_eit_version(void) { return eit_version; } unsigned char get_eit_version(void) { return eit_version; }
// was useful for debugging... // was useful for debugging...
t_channel_id get_current_service(void) { return current_service; } t_channel_id get_current_service(void) { return current_service; }
void setDemux(int dnum) { dmx_num = dnum; }
}; };
#endif /* __sectionsd__dmx_h__ */ #endif /* __sectionsd__dmx_h__ */