198 changes: 99 additions & 99 deletions mythtv/libs/libmythtv/DVD/dvdringbuffer.cpp

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions mythtv/libs/libmythtv/DVD/dvdringbuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ extern "C" {

class MythDVDPlayer;

class MTV_PUBLIC DVDRingBuffer : public RingBuffer
class MTV_PUBLIC MythDVDBuffer : public RingBuffer
{
Q_DECLARE_TR_FUNCTIONS(DVDRingBuffer)

public:
explicit DVDRingBuffer(const QString &Filename);
~DVDRingBuffer() override;
explicit MythDVDBuffer(const QString &Filename);
~MythDVDBuffer() override;

bool IsOpen (void) const override;
bool IsBookmarkAllowed (void) override;
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/DVD/mythdvdcontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
class MTV_PUBLIC MythDVDContext : public ReferenceCounter
{
friend class DVDRingBuffer;
friend class MythDVDBuffer;

public:
MythDVDContext() = delete;
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/DVD/mythdvdinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

class MTV_PUBLIC MythDVDInfo
{
friend class DVDRingBuffer;
friend class MythDVDBuffer;
Q_DECLARE_TR_FUNCTIONS(DVDInfo)

public:
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 @@ -168,7 +168,7 @@ RingBuffer *RingBuffer::Create(const QString &Filename, bool Write,
if (!(mythurl || QFile::exists(filename)))
filename = "/dev/dvd";
LOG(VB_PLAYBACK, LOG_INFO, "Trying DVD at " + filename);
return new DVDRingBuffer(filename);
return new MythDVDBuffer(filename);
}

if (!StreamOnly && (bdurl || bddir))
Expand Down Expand Up @@ -1846,19 +1846,19 @@ bool RingBuffer::IsBD(void) const
return m_type == kRingBuffer_BD;
}

const DVDRingBuffer *RingBuffer::DVD(void) const
const MythDVDBuffer *RingBuffer::DVD(void) const
{
return dynamic_cast<const DVDRingBuffer*>(this);
return dynamic_cast<const MythDVDBuffer*>(this);
}

const BDRingBuffer *RingBuffer::BD(void) const
{
return dynamic_cast<const BDRingBuffer*>(this);
}

DVDRingBuffer *RingBuffer::DVD(void)
MythDVDBuffer *RingBuffer::DVD(void)
{
return dynamic_cast<DVDRingBuffer*>(this);
return dynamic_cast<MythDVDBuffer*>(this);
}

BDRingBuffer *RingBuffer::BD(void)
Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmythtv/ringbuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extern "C" {
#define DEFAULT_CHUNK_SIZE 32768

class ThreadedFileWriter;
class DVDRingBuffer;
class MythDVDBuffer;
class BDRingBuffer;
class LiveTVChain;
class RemoteFile;
Expand Down Expand Up @@ -87,8 +87,8 @@ class MTV_PUBLIC RingBuffer : protected MThread
bool IsDisc (void) const;
bool IsDVD (void) const;
bool IsBD (void) const;
const DVDRingBuffer *DVD (void) const;
DVDRingBuffer *DVD (void);
const MythDVDBuffer *DVD (void) const;
MythDVDBuffer *DVD (void);
const BDRingBuffer *BD (void) const;
BDRingBuffer *BD (void);
int Read (void *Buffer, int Count);
Expand Down
32 changes: 16 additions & 16 deletions mythtv/libs/libmythtv/tv_play.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8349,7 +8349,7 @@ void TV::ShowLCDDVDInfo(const PlayerContext *ctx)
return;
}

DVDRingBuffer *dvd = ctx->m_buffer->DVD();
MythDVDBuffer *dvd = ctx->m_buffer->DVD();
QString dvdName;
QString dvdSerial;
QString mainStatus;
Expand Down Expand Up @@ -12696,22 +12696,22 @@ void TV::DoSeekRWND(PlayerContext *ctx)
*/
void TV::DVDJumpBack(PlayerContext *ctx)
{
auto *dvdrb = dynamic_cast<DVDRingBuffer*>(ctx->m_buffer);
if (!ctx->HasPlayer() || !dvdrb)
auto *dvd = dynamic_cast<MythDVDBuffer*>(ctx->m_buffer);
if (!ctx->HasPlayer() || !dvd)
return;

if (ctx->m_buffer->IsInDiscMenuOrStillFrame())
{
UpdateOSDSeekMessage(ctx, tr("Skip Back Not Allowed"), kOSDTimeout_Med);
}
else if (!dvdrb->StartOfTitle())
else if (!dvd->StartOfTitle())
{
DoJumpChapter(ctx, -1);
}
else
{
uint titleLength = dvdrb->GetTotalTimeOfTitle();
uint chapterLength = dvdrb->GetChapterLength();
uint titleLength = dvd->GetTotalTimeOfTitle();
uint chapterLength = dvd->GetChapterLength();
if ((titleLength == chapterLength) && chapterLength > 300)
{
DoSeek(ctx, -ctx->m_jumptime * 60, tr("Jump Back"),
Expand All @@ -12735,26 +12735,26 @@ void TV::DVDJumpBack(PlayerContext *ctx)
*/
void TV::DVDJumpForward(PlayerContext *ctx)
{
auto *dvdrb = dynamic_cast<DVDRingBuffer*>(ctx->m_buffer);
if (!ctx->HasPlayer() || !dvdrb)
auto *dvd = dynamic_cast<MythDVDBuffer*>(ctx->m_buffer);
if (!ctx->HasPlayer() || !dvd)
return;

bool in_still = dvdrb->IsInStillFrame();
bool in_menu = dvdrb->IsInMenu();
if (in_still && !dvdrb->NumMenuButtons())
bool in_still = dvd->IsInStillFrame();
bool in_menu = dvd->IsInMenu();
if (in_still && !dvd->NumMenuButtons())
{
dvdrb->SkipStillFrame();
dvd->SkipStillFrame();
UpdateOSDSeekMessage(ctx, tr("Skip Still Frame"), kOSDTimeout_Med);
}
else if (!dvdrb->EndOfTitle() && !in_still && !in_menu)
else if (!dvd->EndOfTitle() && !in_still && !in_menu)
{
DoJumpChapter(ctx, 9999);
}
else if (!in_still && !in_menu)
{
uint titleLength = dvdrb->GetTotalTimeOfTitle();
uint chapterLength = dvdrb->GetChapterLength();
uint currentTime = (uint)dvdrb->GetCurrentTime();
uint titleLength = dvd->GetTotalTimeOfTitle();
uint chapterLength = dvd->GetChapterLength();
uint currentTime = (uint)dvd->GetCurrentTime();
if ((titleLength == chapterLength) &&
(currentTime < (chapterLength - (ctx->m_jumptime * 60))) &&
chapterLength > 300)
Expand Down