Skip to content
Browse files

MHEG: Fix race condition when restarting the DSMCC after a channel ch…


When a channel change occurs, the DSMCC file cache must be emptied
so that a consistent filesystem is rebuilt from the new carousel.
MHIContext::Restart, which flushes the cache, is called from TV::ITVRestartv
when the channel or card is changed,  However, the ringbuffer continues
to deliver packets from the old stream for a short period after the
change.  This can produce an invalid file structure which can result
in missing text pages or a failure to start the MHEG app.

This change clears the filesystem cache when a NetBootInfo descriptor
is presented in the PMT, which only occurs after the new stream has started.

Signed-off-by: Lawrence Rust <>
Signed-off-by: Stuart Morgan <>
  • Loading branch information
Lawrence Rust authored and stuartm committed Feb 28, 2012
1 parent a490607 commit 71af16b7a2ea7b26a21b08a3e316347482d01924
Showing with 5 additions and 1 deletion.
  1. +2 −1 mythtv/libs/libmythtv/dsmcc.cpp
  2. +3 −0 mythtv/libs/libmythtv/mhi.cpp
@@ -558,11 +558,12 @@ void Dsmcc::ProcessSection(const unsigned char *data, int length,
// Reset the object carousel and clear the caches.
void Dsmcc::Reset()
LOG(VB_DSMCC, LOG_INFO, "Resetting carousel");
LOG(VB_DSMCC, LOG_INFO, "[dsmcc] Resetting carousel");
QLinkedList<ObjCarousel*>::iterator it = carousels.begin();
for (; it != carousels.end(); ++it)
delete *it;
m_startTag = 0;

int Dsmcc::GetDSMCCObject(QStringList &objectPath, QByteArray &result)
@@ -311,6 +311,9 @@ void MHIContext::SetNetBootInfo(const unsigned char *data, uint length)

QMutexLocker locker(&m_dsmccLock);
// The carousel should be reset now as the stream has changed
// Save the data from the descriptor.

0 comments on commit 71af16b

Please sign in to comment.
You can’t perform that action at this time.