Skip to content

Commit

Permalink
Added back in removed LOC in asi*.cpp
Browse files Browse the repository at this point in the history
Thanks to danielk for the heads up.  I would have caught it later on in the
full sweep through, but since he's ready to use/compile it now, I fast-tracked
this one.
  • Loading branch information
Beirdo committed Jul 7, 2011
1 parent 595f890 commit 62c1fbc
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 30 deletions.
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/asichannel.cpp
Expand Up @@ -24,7 +24,7 @@ ASIChannel::~ASIChannel(void)

bool ASIChannel::Open(void)
{
LOG(VB_CHANNEL, LOG_INFO, "Open()");
LOG(VB_CHANNEL, LOG_INFO, LOC + "Open()");

if (m_device.isEmpty())
return false;
Expand All @@ -45,6 +45,6 @@ bool ASIChannel::Open(void)

void ASIChannel::Close()
{
LOG(VB_CHANNEL, LOG_INFO, "Close()");
LOG(VB_CHANNEL, LOG_INFO, LOC + "Close()");
m_isopen = false;
}
16 changes: 8 additions & 8 deletions mythtv/libs/libmythtv/asirecorder.cpp
Expand Up @@ -70,14 +70,14 @@ void ASIRecorder::StartRecording(void)
if (!Open())
{
_error = "Failed to open device";
LOG(VB_GENERAL, LOG_ERR, _error);
LOG(VB_GENERAL, LOG_ERR, LOC + _error);
return;
}

if (!_stream_data)
{
_error = "MPEGStreamData pointer has not been set";
LOG(VB_GENERAL, LOG_ERR, _error);
LOG(VB_GENERAL, LOG_ERR, LOC + _error);
Close();
return;
}
Expand Down Expand Up @@ -132,7 +132,7 @@ void ASIRecorder::StartRecording(void)

if (!_input_pmt)
{
LOG(VB_GENERAL, LOG_WARNING,
LOG(VB_GENERAL, LOG_WARNING, LOC +
"Recording will not commence until a PMT is set.");
usleep(5000);
continue;
Expand All @@ -141,7 +141,7 @@ void ASIRecorder::StartRecording(void)
if (!m_stream_handler->IsRunning())
{
_error = "Stream handler died unexpectedly.";
LOG(VB_GENERAL, LOG_ERR, _error);
LOG(VB_GENERAL, LOG_ERR, LOC + _error);
}
}

Expand All @@ -162,7 +162,7 @@ bool ASIRecorder::Open(void)
{
if (IsOpen())
{
LOG(VB_GENERAL, LOG_WARNING, "Card already open");
LOG(VB_GENERAL, LOG_WARNING, LOC + "Card already open");
return true;
}

Expand All @@ -173,7 +173,7 @@ bool ASIRecorder::Open(void)

m_stream_handler = ASIStreamHandler::Get(m_channel->GetDevice());

LOG(VB_RECORD, LOG_INFO, "Opened successfully");
LOG(VB_RECORD, LOG_INFO, LOC + "Opened successfully");

return true;
}
Expand All @@ -185,10 +185,10 @@ bool ASIRecorder::IsOpen(void) const

void ASIRecorder::Close(void)
{
LOG(VB_RECORD, LOG_INFO, "Close() -- begin");
LOG(VB_RECORD, LOG_INFO, LOC + "Close() -- begin");

if (IsOpen())
ASIStreamHandler::Return(m_stream_handler);

LOG(VB_RECORD, LOG_INFO, "Close() -- end");
LOG(VB_RECORD, LOG_INFO, LOC + "Close() -- end");
}
8 changes: 4 additions & 4 deletions mythtv/libs/libmythtv/asisignalmonitor.cpp
Expand Up @@ -43,7 +43,7 @@ ASISignalMonitor::ASISignalMonitor(
DTVSignalMonitor(db_cardnum, _channel, _flags),
streamHandlerStarted(false), streamHandler(NULL)
{
LOG(VB_CHANNEL, LOG_INFO, "ctor");
LOG(VB_CHANNEL, LOG_INFO, LOC + "ctor");
streamHandler = ASIStreamHandler::Get(_channel->GetDevice());
}

Expand All @@ -52,7 +52,7 @@ ASISignalMonitor::ASISignalMonitor(
*/
ASISignalMonitor::~ASISignalMonitor()
{
LOG(VB_CHANNEL, LOG_INFO, "dtor");
LOG(VB_CHANNEL, LOG_INFO, LOC + "dtor");
Stop();
ASIStreamHandler::Return(streamHandler);
}
Expand All @@ -62,13 +62,13 @@ ASISignalMonitor::~ASISignalMonitor()
*/
void ASISignalMonitor::Stop(void)
{
LOG(VB_CHANNEL, LOG_INFO, "Stop() -- begin");
LOG(VB_CHANNEL, LOG_INFO, LOC + "Stop() -- begin");
SignalMonitor::Stop();
if (GetStreamData())
streamHandler->RemoveListener(GetStreamData());
streamHandlerStarted = false;

LOG(VB_CHANNEL, LOG_INFO, "Stop() -- end");
LOG(VB_CHANNEL, LOG_INFO, LOC + "Stop() -- end");
}

ASIChannel *ASISignalMonitor::GetASIChannel(void)
Expand Down
33 changes: 17 additions & 16 deletions mythtv/libs/libmythtv/asistreamhandler.cpp
Expand Up @@ -133,11 +133,11 @@ void ASIStreamHandler::SetRunningDesired(bool desired)

void ASIStreamHandler::run(void)
{
LOG(VB_RECORD, LOG_INFO, "run(): begin");
LOG(VB_RECORD, LOG_INFO, LOC + "run(): begin");

if (!Open())
{
LOG(VB_GENERAL, LOG_ERR, QString("Failed to open device %1 : %2")
LOG(VB_GENERAL, LOG_ERR, LOC + QString("Failed to open device %1 : %2")
.arg(_device).arg(strerror(errno)));
_error = true;
return;
Expand All @@ -147,7 +147,7 @@ void ASIStreamHandler::run(void)
bool ok = drb->Setup(_device, _fd, _packet_size, _buf_size);
if (!ok)
{
LOG(VB_GENERAL, LOG_ERR, "Failed to allocate DRB buffer");
LOG(VB_GENERAL, LOG_ERR, LOC + "Failed to allocate DRB buffer");
delete drb;
drb = NULL;
Close();
Expand All @@ -159,7 +159,7 @@ void ASIStreamHandler::run(void)
unsigned char *buffer = new unsigned char[buffer_size];
if (!buffer)
{
LOG(VB_GENERAL, LOG_ERR, "Failed to allocate buffer");
LOG(VB_GENERAL, LOG_ERR, LOC + "Failed to allocate buffer");
delete drb;
drb = NULL;
Close();
Expand Down Expand Up @@ -193,13 +193,13 @@ void ASIStreamHandler::run(void)
// Check for DRB errors
if (drb->IsErrored())
{
LOG(VB_GENERAL, LOG_ERR, "Device error detected");
LOG(VB_GENERAL, LOG_ERR, LOC + "Device error detected");
_error = true;
}

if (drb->IsEOF())
{
LOG(VB_GENERAL, LOC_ERR, "Device EOF detected");
LOG(VB_GENERAL, LOG_ERR, LOC + "Device EOF detected");
_error = true;
}

Expand Down Expand Up @@ -241,7 +241,7 @@ void ASIStreamHandler::run(void)
if (remainder > 0 && (len > remainder)) // leftover bytes
memmove(buffer, &(buffer[len - remainder]), remainder);
}
LOG(VB_RECORD, LOG_INFO, "run(): " + "shutdown");
LOG(VB_RECORD, LOG_INFO, LOC + "run(): " + "shutdown");

RemoveAllPIDFilters();

Expand All @@ -257,7 +257,7 @@ void ASIStreamHandler::run(void)
delete[] buffer;
Close();

LOG(VB_RECORD, LOG_INFO, "run(): " + "end");
LOG(VB_RECORD, LOG_INFO, LOC + "run(): " + "end");

SetRunning(false, true, false);
}
Expand All @@ -271,28 +271,28 @@ bool ASIStreamHandler::Open(void)
_device_num = CardUtil::GetASIDeviceNumber(_device, &error);
if (_device_num < 0)
{
LOG(VB_GENERAL, LOG_ERR, error);
LOG(VB_GENERAL, LOG_ERR, LOC + error);
return false;
}

_buf_size = CardUtil::GetASIBufferSize(_device_num, &error);
if (_buf_size <= 0)
{
LOG(VB_GENERAL, LOG_ERR, error);
LOG(VB_GENERAL, LOG_ERR, LOC + error);
return false;
}

if (!CardUtil::SetASIMode(_device_num, (uint)_rx_mode, &error))
{
LOG(VB_GENERAL, LOG_ERR, "Failed to set RX Mode: " + error);
LOG(VB_GENERAL, LOG_ERR, LOC + "Failed to set RX Mode: " + error);
return false;
}

// actually open the device
_fd = open(_device.toLocal8Bit().constData(), O_RDONLY, 0);
if (_fd < 0)
{
LOG(VB_GENERAL, LOG_ERR,
LOG(VB_GENERAL, LOG_ERR, LOC +
QString("Failed to open '%1'").arg(_device) + ENO);
return false;
}
Expand All @@ -301,8 +301,8 @@ bool ASIStreamHandler::Open(void)
unsigned int cap;
if (ioctl(_fd, ASI_IOC_RXGETCAP, &cap) < 0)
{
LOG(VB_GENERAL, LOG_ERR, QString("Failed to query capabilities '%1'")
.arg(_device) + ENO);
LOG(VB_GENERAL, LOG_ERR, LOC +
QString("Failed to query capabilities '%1'").arg(_device) + ENO);
Close();
return false;
}
Expand Down Expand Up @@ -375,8 +375,9 @@ static bool named_output_file_common(
int ret = link(ba.constData(), it.key().toLocal8Bit().constData());
if (ret < 0)
{
LOG(VB_GENERAL, LOG_ERR, QString("Failed to link '%1' to '%2'")
.arg(it.key()).arg(fn) + ENO);
LOG(VB_GENERAL, LOG_ERR, LOC +
QString("Failed to link '%1' to '%2'").arg(it.key()).arg(fn) +
ENO);
}
ok &= ret >= 0;
}
Expand Down

0 comments on commit 62c1fbc

Please sign in to comment.