Skip to content

Commit

Permalink
Make sure DeviceReadBuffer::videodevice is never QString::null, this …
Browse files Browse the repository at this point in the history
…will cause the logging to segfault.
  • Loading branch information
daniel-kristjansson committed Jul 26, 2011
1 parent 56350fb commit 23305b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mythtv/libs/libmythtv/DeviceReadBuffer.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 23305b9

Please sign in to comment.