Skip to content

Commit

Permalink
Ringbuffer part of Daniel Kristjansson's 'mythtv blocking/crashing fix'.
Browse files Browse the repository at this point in the history
Non-intrusive changes from Kenneth Aafloy's most recent patch (settings name
corrections, record_ts error fix).


git-svn-id: http://svn.mythtv.org/svn/trunk@3055 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information
Isaac Richards committed Jan 31, 2004
1 parent a24709f commit 4c0e652
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
15 changes: 15 additions & 0 deletions mythtv/libs/libmythtv/RingBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -812,13 +812,28 @@ int RingBuffer::ReadFromBuf(void *buf, int count)

int avail = ReadBufAvail();

int readErr = 0;

while (avail < count && !stopreads)
{
availWaitMutex.lock();
wanttoread = count;
if (!availWait.wait(&availWaitMutex, 2000))
{
cerr << "Waited 2 seconds for data to become available, waiting "
"again...\n";
readErr++;
if (readErr > 7)
{
cerr << "Waited 14 seconds for data to become available, "
"aborting\n";
wanttoread = 0;
stopreads = true;
availWaitMutex.unlock();
return 0;
}
}

wanttoread = 0;
availWaitMutex.unlock();

Expand Down
5 changes: 3 additions & 2 deletions mythtv/libs/libmythtv/dvbrecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ void DVBRecorder::SetOption(const QString &name, int value)
swfilter = (value == 1);
else if (name == "recordts")
{
GENERAL("Was told to record transport stream,"
" but this feature is broken, not enabling.");
if (value == 1)
GENERAL("Was told to record transport stream,"
" but this feature is broken, not enabling.");
// recordts = (value == 1);
}
else if (name == "wait_for_seqstart")
Expand Down
13 changes: 7 additions & 6 deletions mythtv/libs/libmythtv/videosource.h
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ class DVBCardName: public LabelSetting, public TransientStorage {
class DVBSwFilter: public CheckBoxSetting, public CCSetting {
public:
DVBSwFilter(const CaptureCard& parent):
CCSetting(parent, "use_swfilter") {
CCSetting(parent, "dvb_swfilter") {
setLabel(QObject::tr("Do NOT use DVB driver for filtering."));
setHelpText(QObject::tr("(BROKEN) This option is used to get around "
"filtering limitations on some DVB cards."));
Expand All @@ -427,7 +427,7 @@ class DVBSwFilter: public CheckBoxSetting, public CCSetting {
class DVBRecordTS: public CheckBoxSetting, public CCSetting {
public:
DVBRecordTS(const CaptureCard& parent):
CCSetting(parent, "record_ts") {
CCSetting(parent, "dvb_recordts") {
setLabel(QObject::tr("Record the TS, not PS."));
setHelpText(QObject::tr("This will make the backend not perform "
"Transport Stream to Program Stream conversion."));
Expand All @@ -437,8 +437,9 @@ class DVBRecordTS: public CheckBoxSetting, public CCSetting {
class DVBNoSeqStart: public CheckBoxSetting, public CCSetting {
public:
DVBNoSeqStart(const CaptureCard& parent):
CCSetting(parent, "no_seq_start") {
setLabel(QObject::tr("Do not wait for SEQ start header."));
CCSetting(parent, "dvb_wait_for_seqstart") {
setLabel(QObject::tr("Wait for SEQ start header."));
setValue(true);
setHelpText(QObject::tr("Normally the dvb-recording will drop packets "
"from the card untill a sequence start header is seen. "
"This option turns off this feature."));
Expand All @@ -449,7 +450,7 @@ class DVBPidBufferSize: public SpinBoxSetting, public CCSetting {
public:
DVBPidBufferSize(const CaptureCard& parent):
SpinBoxSetting(0, 180000, 188),
CCSetting(parent, "dmx_buf_size") {
CCSetting(parent, "dvb_dmx_buf_size") {
setLabel(QObject::tr("Per PID driver buffer size"));
setValue(188*50);
};
Expand All @@ -459,7 +460,7 @@ class DVBBufferSize: public SpinBoxSetting, public CCSetting {
public:
DVBBufferSize(const CaptureCard& parent):
SpinBoxSetting(0, 188000, 188),
CCSetting(parent, "pkt_buf_size") {
CCSetting(parent, "dvb_pkt_buf_size") {
setLabel(QObject::tr("Packet buffer"));
setValue(188*100);
};
Expand Down

0 comments on commit 4c0e652

Please sign in to comment.