Permalink
Browse files

Make sure DeviceReadBuffer::videodevice is never QString::null, this …

…will cause the logging to segfault.
  • Loading branch information...
1 parent 56350fb commit 23305b9ca1195f65c3c4f6ebe49e730522dafcaa @daniel-kristjansson daniel-kristjansson committed Jul 26, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 mythtv/libs/libmythtv/DeviceReadBuffer.cpp
@@ -18,7 +18,7 @@ using namespace std;
#define LOC_ERR QString("DevRdB(%1) Error: ").arg(videodevice)
DeviceReadBuffer::DeviceReadBuffer(ReaderPausedCB *cb, bool use_poll)
- : videodevice(QString::null), _stream_fd(-1),
+ : videodevice(""), _stream_fd(-1),
readerPausedCB(cb),
// Data for managing the device ringbuffer
@@ -53,6 +53,7 @@ bool DeviceReadBuffer::Setup(const QString &streamName, int streamfd)
delete[] buffer;
videodevice = streamName;
+ videodevice = (videodevice == QString::null) ? "" : videodevice;
_stream_fd = streamfd;
// BEGIN HACK -- see #6897
@@ -124,6 +125,7 @@ void DeviceReadBuffer::Reset(const QString &streamName, int streamfd)
QMutexLocker locker(&lock);
videodevice = streamName;
+ videodevice = (videodevice == QString::null) ? "" : videodevice;
_stream_fd = streamfd;
used = 0;

0 comments on commit 23305b9

Please sign in to comment.