Skip to content

Commit

Permalink
libmythtv: Rename DVDStream->MythDVDStream
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-kendall committed Apr 8, 2020
1 parent 8aa010a commit ccb23a7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
18 changes: 9 additions & 9 deletions mythtv/libs/libmythtv/dvdstream.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* DVD stream
/* MythDVDStream
* Copyright 2011 Lawrence Rust <lvr at softsystem dot co dot uk>
*/

Expand All @@ -25,7 +25,7 @@ extern "C" {
#define LOC QString("DVDStream: ")

/// \class DVDStream::BlockRange A range of block numbers
class DVDStream::BlockRange
class MythDVDStream::BlockRange
{
public:
BlockRange(uint32_t Start, uint32_t Count, int Title)
Expand Down Expand Up @@ -63,13 +63,13 @@ inline uint32_t Len2Blocks(uint32_t Length)
}

/// \class DVDStream Stream content from a DVD image file
DVDStream::DVDStream(const QString& Filename)
MythDVDStream::MythDVDStream(const QString& Filename)
: RingBuffer(kRingBuffer_File)
{
OpenFile(Filename);
}

DVDStream::~DVDStream()
MythDVDStream::~MythDVDStream()
{
KillReadAheadThread();
m_rwLock.lockForWrite();
Expand All @@ -84,7 +84,7 @@ DVDStream::~DVDStream()
* \param Filename Path of the dvd device to read.
* \return Returns true if the dvd was opened.
*/
bool DVDStream::OpenFile(const QString &Filename, uint /*Retry*/)
bool MythDVDStream::OpenFile(const QString &Filename, uint /*Retry*/)
{
m_rwLock.lockForWrite();

Expand Down Expand Up @@ -162,15 +162,15 @@ bool DVDStream::OpenFile(const QString &Filename, uint /*Retry*/)
return true;
}

bool DVDStream::IsOpen(void) const
bool MythDVDStream::IsOpen(void) const
{
m_rwLock.lockForRead();
bool ret = m_reader != nullptr;
m_rwLock.unlock();
return ret;
}

int DVDStream::SafeRead(void *Buffer, uint Size)
int MythDVDStream::SafeRead(void *Buffer, uint Size)
{
uint32_t block = Size / DVD_VIDEO_LB_LEN;
if (block < 1)
Expand Down Expand Up @@ -248,7 +248,7 @@ int DVDStream::SafeRead(void *Buffer, uint Size)
return ret * DVD_VIDEO_LB_LEN;
}

long long DVDStream::SeekInternal(long long Position, int Whence)
long long MythDVDStream::SeekInternal(long long Position, int Whence)
{
if (!m_reader)
return -1;
Expand All @@ -273,7 +273,7 @@ long long DVDStream::SeekInternal(long long Position, int Whence)
return Position;
}

long long DVDStream::GetReadPosition(void) const
long long MythDVDStream::GetReadPosition(void) const
{
m_posLock.lockForRead();
long long ret = static_cast<long long>(m_pos) * DVD_VIDEO_LB_LEN;
Expand Down
8 changes: 4 additions & 4 deletions mythtv/libs/libmythtv/dvdstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

using dvd_reader_t = struct dvd_reader_s;

class MTV_PUBLIC DVDStream : public RingBuffer
class MTV_PUBLIC MythDVDStream : public RingBuffer
{
public:
class BlockRange;

explicit DVDStream(const QString &Filename);
~DVDStream() override;
explicit MythDVDStream(const QString &Filename);
~MythDVDStream() override;

long long GetReadPosition (void) const override;
bool IsOpen (void) const override;
Expand All @@ -33,7 +33,7 @@ class MTV_PUBLIC DVDStream : public RingBuffer
long long SeekInternal (long long Position, int Whence) override;

private:
Q_DISABLE_COPY(DVDStream)
Q_DISABLE_COPY(MythDVDStream)

dvd_reader_t *m_reader { nullptr };
uint32_t m_start { 0 };
Expand Down
10 changes: 5 additions & 5 deletions mythtv/libs/libmythtv/ringbuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,16 @@ RingBuffer *RingBuffer::Create(const QString &Filename, bool Write,
if (!mythurl && imgext && filename.startsWith("dvd:"))
{
LOG(VB_PLAYBACK, LOG_INFO, "DVD image at " + filename);
return new DVDStream(filename);
return new MythDVDStream(filename);
}

if (!mythurl && lower.endsWith(".vob") && filename.contains("/VIDEO_TS/"))
{
LOG(VB_PLAYBACK, LOG_INFO, "DVD VOB at " + filename);
auto *s = new DVDStream(filename);
if (s && s->IsOpen())
return s;
delete s;
auto *dvdstream = new MythDVDStream(filename);
if (dvdstream && dvdstream->IsOpen())
return dvdstream;
delete dvdstream;
}

return new FileRingBuffer(filename, Write, UseReadAhead, Timeout);
Expand Down

0 comments on commit ccb23a7

Please sign in to comment.