From 851b080f37099bcf9faeb6ea7718f9b82effc7fb Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 12 Jun 2013 18:18:34 +0400 Subject: [PATCH] eitd/dmx.cpp: delete demux instead of stop in closefd, add helper to set demux number Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8bedb877ddc82f7e8130f42e36b4f47211d4f0a3 Author: [CST] Focus Date: 2013-06-12 (Wed, 12 Jun 2013) ------------------ This commit was generated by Migit --- src/eitd/dmx.cpp | 9 +++++++-- src/eitd/dmx.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/eitd/dmx.cpp b/src/eitd/dmx.cpp index ee75a6e05..3850c3983 100644 --- a/src/eitd/dmx.cpp +++ b/src/eitd/dmx.cpp @@ -117,11 +117,13 @@ void DMX::close(void) void DMX::closefd(void) { #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 if (isOpen()) { - dmx->Stop(); + //dmx->Stop(); + delete dmx; + dmx = NULL; fd = -1; } } @@ -484,6 +486,9 @@ int DMX::immediate_start(void) } if(dmx == NULL) { +#ifdef DEBUG_DEMUX + xcprintf(" %s: open demux #%d", name.c_str(), dmx_num); +#endif dmx = new cDemux(dmx_num); dmx->Open(DMX_PSI_CHANNEL, NULL, dmxBufferSizeInKB*1024UL); } diff --git a/src/eitd/dmx.h b/src/eitd/dmx.h index f05a09f77..38d30a31a 100644 --- a/src/eitd/dmx.h +++ b/src/eitd/dmx.h @@ -126,6 +126,7 @@ public: unsigned char get_eit_version(void) { return eit_version; } // was useful for debugging... t_channel_id get_current_service(void) { return current_service; } + void setDemux(int dnum) { dmx_num = dnum; } }; #endif /* __sectionsd__dmx_h__ */