21 changes: 11 additions & 10 deletions mythtv/libs/libmythtv/recorders/ExternalStreamHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ bool ExternalStreamHandler::SetAPIVersion(void)
{
QString result;

if (ProcessCommand("APIVersion?", result, 10000))
if (ProcessCommand("APIVersion?", result, 10s))
{
#if QT_VERSION < QT_VERSION_CHECK(5,14,0)
QStringList tokens = result.split(':', QString::SkipEmptyParts);
Expand Down Expand Up @@ -1001,7 +1001,7 @@ bool ExternalStreamHandler::IsAppOpen(void)
}

QString result;
return ProcessCommand("Version?", result, 10000);
return ProcessCommand("Version?", result, 10s);
}

bool ExternalStreamHandler::IsTSOpen(void)
Expand All @@ -1027,7 +1027,7 @@ void ExternalStreamHandler::CloseApp(void)

LOG(VB_RECORD, LOG_INFO, LOC + "CloseRecorder");
m_ioLock.unlock();
ProcessCommand("CloseRecorder", result, 10000);
ProcessCommand("CloseRecorder", result, 10s);
m_ioLock.lock();

if (!result.startsWith("OK"))
Expand Down Expand Up @@ -1136,7 +1136,7 @@ bool ExternalStreamHandler::StartStreaming(void)

if (StreamingCount() == 0)
{
if (!ProcessCommand("StartStreaming", result, 15000))
if (!ProcessCommand("StartStreaming", result, 15s))
{
LogLevel_t level = LOG_ERR;
if (result.startsWith("warn", Qt::CaseInsensitive))
Expand Down Expand Up @@ -1203,7 +1203,7 @@ bool ExternalStreamHandler::StopStreaming(void)
}

QString result;
if (!ProcessCommand("StopStreaming", result, 10000))
if (!ProcessCommand("StopStreaming", result, 10s))
{
LogLevel_t level = LOG_ERR;
if (result.startsWith("warn", Qt::CaseInsensitive))
Expand All @@ -1224,7 +1224,8 @@ bool ExternalStreamHandler::StopStreaming(void)
}

bool ExternalStreamHandler::ProcessCommand(const QString & cmd,
QString & result, int timeout,
QString & result,
std::chrono::milliseconds timeout,
uint retry_cnt)
{
QMutexLocker locker(&m_processLock);
Expand All @@ -1240,10 +1241,10 @@ bool ExternalStreamHandler::ProcessCommand(const QString & cmd,
}

bool ExternalStreamHandler::ProcessVer1(const QString & cmd,
QString & result, int _timeout,
QString & result,
std::chrono::milliseconds timeout,
uint retry_cnt)
{
auto timeout = std::chrono::milliseconds(_timeout);
LOG(VB_RECORD, LOG_DEBUG, LOC + QString("ProcessVer1('%1')")
.arg(cmd));

Expand Down Expand Up @@ -1346,10 +1347,10 @@ bool ExternalStreamHandler::ProcessVer1(const QString & cmd,
}

bool ExternalStreamHandler::ProcessVer2(const QString & command,
QString & result, int _timeout,
QString & result,
std::chrono::milliseconds timeout,
uint retry_cnt)
{
auto timeout = std::chrono::milliseconds(_timeout);
QString status;
QString raw;

Expand Down
7 changes: 4 additions & 3 deletions mythtv/libs/libmythtv/recorders/ExternalStreamHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,12 @@ class ExternalStreamHandler : public StreamHandler
void PurgeBuffer(void);

bool ProcessCommand(const QString & cmd, QString & result,
int timeout = 4000 /* ms */,uint retry_cnt = 3);
std::chrono::milliseconds timeout = 4s,
uint retry_cnt = 3);
bool ProcessVer1(const QString & cmd, QString & result,
int timeout /* ms */, uint retry_cnt);
std::chrono::milliseconds timeout, uint retry_cnt);
bool ProcessVer2(const QString & command, QString & result,
int timeout /* ms */, uint retry_cnt);
std::chrono::milliseconds timeout, uint retry_cnt);

private:
int StreamingCount(void) const;
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/recorders/cetonrecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void CetonRecorder::run(void)
LOG(VB_RECORD, LOG_INFO, LOC + "run -- end");
}

bool CetonRecorder::PauseAndWait(int timeout)
bool CetonRecorder::PauseAndWait(std::chrono::milliseconds timeout)
{
QMutexLocker locker(&m_pauseLock);
if (m_requestPause)
Expand All @@ -139,7 +139,7 @@ bool CetonRecorder::PauseAndWait(int timeout)
m_tvrec->RecorderPaused();
}

m_unpauseWait.wait(&m_pauseLock, timeout);
m_unpauseWait.wait(&m_pauseLock, timeout.count());
}

if (!m_requestPause && IsPaused(true))
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/recorders/cetonrecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class CetonRecorder : public DTVRecorder

private:
void ReaderPaused(int fd);
bool PauseAndWait(int timeout = 100) override; // RecorderBase
bool PauseAndWait(std::chrono::milliseconds timeout = 100ms) override; // RecorderBase

private:
CetonChannel *m_channel {nullptr};
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/recorders/dvbrecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ void DVBRecorder::run(void)
m_recordingWait.wakeAll();
}

bool DVBRecorder::PauseAndWait(int timeout)
bool DVBRecorder::PauseAndWait(std::chrono::milliseconds timeout)
{
QMutexLocker locker(&m_pauseLock);
if (m_requestPause)
Expand All @@ -182,7 +182,7 @@ bool DVBRecorder::PauseAndWait(int timeout)
m_tvrec->RecorderPaused();
}

m_unpauseWait.wait(&m_pauseLock, timeout);
m_unpauseWait.wait(&m_pauseLock, timeout.count());
}

if (!m_requestPause && IsPaused(true))
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/recorders/dvbrecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class DVBRecorder : public DTVRecorder
void StartNewFile(void) override; // RecorderBase

private:
bool PauseAndWait(int timeout = 100) override; // RecorderBase
bool PauseAndWait(std::chrono::milliseconds timeout = 100ms) override; // RecorderBase

QString GetSIStandard(void) const override; // DTVRecorder
void SetCAMPMT(const ProgramMapTable *pmt) override; // DTVRecorder
Expand Down
8 changes: 4 additions & 4 deletions mythtv/libs/libmythtv/recorders/firewirerecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,13 @@ void FirewireRecorder::SetOptionsFromProfile(RecordingProfile *profile,
}

// documented in recorderbase.cpp
bool FirewireRecorder::PauseAndWait(int timeout)
bool FirewireRecorder::PauseAndWait(std::chrono::milliseconds timeout)
{
QMutexLocker locker(&m_pauseLock);
if (m_requestPause)
{
LOG(VB_RECORD, LOG_INFO, LOC +
QString("PauseAndWait(%1) -- pause").arg(timeout));
QString("PauseAndWait(%1) -- pause").arg(timeout.count()));
if (!IsPaused(true))
{
StopStreaming();
Expand All @@ -199,13 +199,13 @@ bool FirewireRecorder::PauseAndWait(int timeout)
if (m_tvrec)
m_tvrec->RecorderPaused();
}
m_unpauseWait.wait(&m_pauseLock, timeout);
m_unpauseWait.wait(&m_pauseLock, timeout.count());
}

if (!m_requestPause && IsPaused(true))
{
LOG(VB_RECORD, LOG_INFO, LOC +
QString("PauseAndWait(%1) -- unpause").arg(timeout));
QString("PauseAndWait(%1) -- unpause").arg(timeout.count()));
m_paused = false;
StartStreaming();
m_unpauseWait.wakeAll();
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/recorders/firewirerecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class FirewireRecorder :
void StopStreaming(void);

void run(void) override; // RecorderBase
bool PauseAndWait(int timeout = 100) override; // RecorderBase
bool PauseAndWait(std::chrono::milliseconds timeout = 100ms) override; // RecorderBase

// Implements TSDataListener
void AddData(const unsigned char *data, uint len) override; // TSDataListener
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/recorders/hdhrrecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ void HDHRRecorder::run(void)
LOG(VB_RECORD, LOG_INFO, LOC + "run -- end");
}

bool HDHRRecorder::PauseAndWait(int timeout)
bool HDHRRecorder::PauseAndWait(std::chrono::milliseconds timeout)
{
QMutexLocker locker(&m_pauseLock);
if (m_requestPause)
Expand All @@ -170,7 +170,7 @@ bool HDHRRecorder::PauseAndWait(int timeout)
m_tvrec->RecorderPaused();
}

m_unpauseWait.wait(&m_pauseLock, timeout);
m_unpauseWait.wait(&m_pauseLock, timeout.count());
}

if (!m_requestPause && IsPaused(true))
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/recorders/hdhrrecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class HDHRRecorder : public DTVRecorder

private:
void ReaderPaused(int fd);
bool PauseAndWait(int timeout = 100) override; // RecorderBase
bool PauseAndWait(std::chrono::milliseconds timeout = 100ms) override; // RecorderBase

private:
HDHRChannel *m_channel {nullptr};
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/recorders/importrecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void ImportRecorder::run(void)
{
auto *ctx = new PlayerContext(kImportRecorderInUseID);
auto *cfp = new MythCommFlagPlayer(ctx, (PlayerFlags)(kAudioMuted | kVideoIsNull | kNoITV));
MythMediaBuffer *buffer = MythMediaBuffer::Create(m_ringBuffer->GetFilename(), false, true, 6000);
MythMediaBuffer *buffer = MythMediaBuffer::Create(m_ringBuffer->GetFilename(), false, true, 6s);
//This does update the status but does not set the ultimate
//recorded / failure status for the relevant recording
SetRecordingStatus(RecStatus::Recording, __FILE__, __LINE__);
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/recorders/iptvrecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void IPTVRecorder::SetStreamData(MPEGStreamData *data)
m_channel->SetStreamData(m_streamData);
}

bool IPTVRecorder::PauseAndWait(int timeout)
bool IPTVRecorder::PauseAndWait(std::chrono::milliseconds timeout)
{
QMutexLocker locker(&m_pauseLock);
if (m_requestPause)
Expand All @@ -84,7 +84,7 @@ bool IPTVRecorder::PauseAndWait(int timeout)
m_tvrec->RecorderPaused();
}

m_unpauseWait.wait(&m_pauseLock, timeout);
m_unpauseWait.wait(&m_pauseLock, timeout.count());
}

if (!m_requestPause && IsPaused(true))
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/recorders/iptvrecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class IPTVRecorder : public DTVRecorder
void StartNewFile(void) override; // RecorderBase

void SetStreamData(MPEGStreamData *data) override; // DTVRecorder
bool PauseAndWait(int timeout = 100) override; // RecorderBase
bool PauseAndWait(std::chrono::milliseconds timeout = 100ms) override; // RecorderBase

void run(void) override; // RecorderBase

Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmythtv/recorders/mpegrecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ void MpegRecorder::run(void)
QByteArray vdevice = m_videodevice.toLatin1();
while (IsRecordingRequested() && !IsErrored())
{
if (PauseAndWait(100))
if (PauseAndWait(100ms))
continue;

if (m_deviceIsMpegFile)
Expand Down Expand Up @@ -1238,7 +1238,7 @@ void MpegRecorder::Pause(bool clear)
m_requestPause = true;
}

bool MpegRecorder::PauseAndWait(int timeout)
bool MpegRecorder::PauseAndWait(std::chrono::milliseconds timeout)
{
QMutexLocker locker(&m_pauseLock);
if (m_requestPause)
Expand All @@ -1256,7 +1256,7 @@ bool MpegRecorder::PauseAndWait(int timeout)
m_tvrec->RecorderPaused();
}

m_unpauseWait.wait(&m_pauseLock, timeout);
m_unpauseWait.wait(&m_pauseLock, timeout.count());
}

if (!m_requestPause && IsPaused(true))
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/recorders/mpegrecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class MpegRecorder : public V4LRecorder,
void Reset(void) override; // DTVRecorder

void Pause(bool clear = true) override; // RecorderBase
bool PauseAndWait(int timeout = 100) override; // RecorderBase
bool PauseAndWait(std::chrono::milliseconds timeout = 100ms) override; // RecorderBase

bool IsRecording(void) override // RecorderBase
{ return m_recording; }
Expand Down
12 changes: 6 additions & 6 deletions mythtv/libs/libmythtv/recorders/recorderbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,15 +288,15 @@ bool RecorderBase::IsPaused(bool holding_lock) const
return ret;
}

/** \fn RecorderBase::WaitForPause(int)
/**
* \brief WaitForPause blocks until recorder is actually paused,
* or timeout milliseconds elapse.
* \param timeout number of milliseconds to wait defaults to 1000.
* \return true iff pause happened within timeout period.
*/
bool RecorderBase::WaitForPause(int _timeout)
bool RecorderBase::WaitForPause(std::chrono::milliseconds timeout)
{
auto timeout = std::chrono::milliseconds(_timeout);
MythTimer t;
t.start();

Expand All @@ -311,7 +311,7 @@ bool RecorderBase::WaitForPause(int _timeout)
return true;
}

/** \fn RecorderBase::PauseAndWait(int)
/**
* \brief If m_requestPause is true, sets pause and blocks up to
* timeout milliseconds or until unpaused, whichever is
* sooner.
Expand All @@ -323,7 +323,7 @@ bool RecorderBase::WaitForPause(int _timeout)
* \param timeout number of milliseconds to wait defaults to 100.
* \return true if recorder is paused.
*/
bool RecorderBase::PauseAndWait(int timeout)
bool RecorderBase::PauseAndWait(std::chrono::milliseconds timeout)
{
QMutexLocker locker(&m_pauseLock);
if (m_requestPause)
Expand All @@ -336,7 +336,7 @@ bool RecorderBase::PauseAndWait(int timeout)
m_tvrec->RecorderPaused();
}

m_unpauseWait.wait(&m_pauseLock, timeout);
m_unpauseWait.wait(&m_pauseLock, timeout.count());
}

if (!m_requestPause && IsPaused(true))
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/recorders/recorderbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class MTV_PUBLIC RecorderBase : public QRunnable
virtual void Pause(bool clear = true);
virtual void Unpause(void);
virtual bool IsPaused(bool holding_lock = false) const;
virtual bool WaitForPause(int timeout = 1000);
virtual bool WaitForPause(std::chrono::milliseconds timeout = 1s);

/** \brief Returns the latest frame rate.
*/
Expand Down Expand Up @@ -264,7 +264,7 @@ class MTV_PUBLIC RecorderBase : public QRunnable
* \sa SetOption(const QString&, const QString&)
*/
void SetStrOption(RecordingProfile *profile, const QString &name);
virtual bool PauseAndWait(int timeout = 100);
virtual bool PauseAndWait(std::chrono::milliseconds timeout = 100ms);

virtual void ResetForNewFile(void) = 0;
virtual void SetRecordingStatus(RecStatus::Type status,
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/recorders/satiprecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ void SatIPRecorder::run(void)
LOG(VB_RECORD, LOG_INFO, LOC + "run -- end");
}

bool SatIPRecorder::PauseAndWait(int timeout)
bool SatIPRecorder::PauseAndWait(std::chrono::milliseconds timeout)
{
QMutexLocker locker(&m_pauseLock);
if (m_requestPause)
Expand All @@ -165,7 +165,7 @@ bool SatIPRecorder::PauseAndWait(int timeout)
m_tvrec->RecorderPaused();
}

m_unpauseWait.wait(&m_pauseLock, timeout);
m_unpauseWait.wait(&m_pauseLock, timeout.count());
}

if (!m_requestPause && IsPaused(true))
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/recorders/satiprecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class SatIPRecorder : public DTVRecorder
const QString &vbidev) override; // RecorderBase

private:
bool PauseAndWait(int timeout = 100) override; // RecorderBase
bool PauseAndWait(std::chrono::milliseconds timeout = 100ms) override; // RecorderBase

private:
SatIPChannel *m_channel {nullptr};
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/recorders/v4l2encrecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ void V4L2encRecorder::Close(void)
LOG(VB_RECORD, LOG_INFO, LOC + "Close() -- end");
}

bool V4L2encRecorder::PauseAndWait(int timeout)
bool V4L2encRecorder::PauseAndWait(std::chrono::milliseconds timeout)
{
QMutexLocker locker(&m_pauseLock);
if (m_requestPause)
Expand Down Expand Up @@ -313,7 +313,7 @@ bool V4L2encRecorder::PauseAndWait(int timeout)
}

// Always wait a little bit, unless woken up
m_unpauseWait.wait(&m_pauseLock, timeout);
m_unpauseWait.wait(&m_pauseLock, timeout.count());

return IsPaused(true);
}
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/recorders/v4l2encrecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class V4L2encRecorder : public V4LRecorder
void Close(void);
void StartNewFile(void) override; // RecorderBase

bool PauseAndWait(int timeout = 500) override; // RecorderBase
bool PauseAndWait(std::chrono::milliseconds timeout = 500ms) override; // RecorderBase

protected:
bool StartEncoding(void);
Expand Down
15 changes: 6 additions & 9 deletions mythtv/libs/libmythtv/tv_play.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,18 +261,16 @@ bool TV::CreatePlayer(TVState State, bool Muted)
m_playerContext.SetPlayer(player);
emit InitialisePlayerState();
m_player = player;
return StartPlaying(-1);
return StartPlaying(-1ms);
}

/** \fn PlayerContext::StartPlaying(int)
* \brief Starts player, must be called after StartRecorder().
* \param MaxWait How long to wait for MythPlayer to start playing.
* \return true when successful, false otherwise.
*/
bool TV::StartPlaying(int _MaxWait)
bool TV::StartPlaying(std::chrono::milliseconds MaxWait)
{
auto MaxWait = std::chrono::milliseconds(_MaxWait);

if (!m_player)
return false;

Expand All @@ -290,7 +288,7 @@ bool TV::StartPlaying(int _MaxWait)
MythTimer t;
t.start();

while (!m_player->IsPlaying(50, true) && (t.elapsed() < MaxWait))
while (!m_player->IsPlaying(50ms, true) && (t.elapsed() < MaxWait))
m_playerContext.ReloadTVChain();

if (m_player->IsPlaying())
Expand Down Expand Up @@ -2123,7 +2121,7 @@ void TV::HandleStateChange()
m_playerContext.SetRingBuffer(
MythMediaBuffer::Create(
playbackURL, false, true,
opennow ? MythMediaBuffer::kLiveTVOpenTimeout : -1));
opennow ? MythMediaBuffer::kLiveTVOpenTimeout : -1ms));

if (m_playerContext.m_buffer)
m_playerContext.m_buffer->SetLiveMode(m_playerContext.m_tvchain);
Expand Down Expand Up @@ -2348,10 +2346,9 @@ void TV::HandleStateChange()
* not provided, this defaults to 40 seconds.
* \return true when successful, false otherwise.
*/
bool TV::StartRecorder(int _MaxWait)
bool TV::StartRecorder(std::chrono::milliseconds MaxWait)
{
RemoteEncoder *rec = m_playerContext.m_recorder;
auto MaxWait = std::chrono::milliseconds(_MaxWait);
MaxWait = (MaxWait <= 0ms) ? 40s : MaxWait;
MythTimer t;
t.start();
Expand Down Expand Up @@ -5679,7 +5676,7 @@ void TV::SwitchInputs(uint ChanID, QString ChanNum, uint InputID)
m_playerContext.SetRingBuffer(
MythMediaBuffer::Create(
playbackURL, false, true,
opennow ? MythMediaBuffer::kLiveTVOpenTimeout : -1));
opennow ? MythMediaBuffer::kLiveTVOpenTimeout : -1ms));

m_playerContext.m_tvchain->SetProgram(*m_playerContext.m_playingInfo);
if (m_playerContext.m_buffer)
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/tv_play.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class MTV_PUBLIC TV : public TVPlaybackState, public MythTVMenuItemDisplayer, pu
~TV() override;
PlayerContext* GetPlayerContext();
bool CreatePlayer(TVState State, bool Muted = false);
bool StartPlaying(int MaxWait = -1);
bool StartPlaying(std::chrono::milliseconds MaxWait = -1ms);

// Private initialisation
static TV* AcquireRelease(int& RefCount, bool Acquire, bool Create = false);
Expand Down Expand Up @@ -299,7 +299,7 @@ class MTV_PUBLIC TV : public TVPlaybackState, public MythTVMenuItemDisplayer, pu
bool RequestNextRecorder(bool ShowDialogs, const ChannelInfoList &Selection = ChannelInfoList());
void DeleteRecorder();

bool StartRecorder(int MaxWait = -1);
bool StartRecorder(std::chrono::milliseconds MaxWait = -1ms);
void StopStuff(bool StopRingBuffer, bool StopPlayer, bool StopRecorder);
bool StartPlayer(TVState desiredState);

Expand Down
3 changes: 1 addition & 2 deletions mythtv/libs/libmythtv/tv_rec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1517,9 +1517,8 @@ void TVRec::run(void)
* You MUST HAVE the stateChange-lock locked when you call this method!
*/

bool TVRec::WaitForEventThreadSleep(bool wake, ulong _time)
bool TVRec::WaitForEventThreadSleep(bool wake, std::chrono::milliseconds time)
{
auto time = std::chrono::milliseconds(_time);
bool ok = false;
MythTimer t;
t.start();
Expand Down
3 changes: 2 additions & 1 deletion mythtv/libs/libmythtv/tv_rec.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ class MTV_PUBLIC TVRec : public SignalMonitorListener, public QRunnable

protected:
void run(void) override; // QRunnable
bool WaitForEventThreadSleep(bool wake = true, ulong time = ULONG_MAX);
bool WaitForEventThreadSleep(bool wake = true,
std::chrono::milliseconds time = std::chrono::milliseconds::max());

private:
void SetRingBuffer(MythMediaBuffer* Buffer);
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythavtest/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class VideoPerformanceTest

void Test(void)
{
MythMediaBuffer *rb = MythMediaBuffer::Create(m_file, false, true, 2000);
MythMediaBuffer *rb = MythMediaBuffer::Create(m_file, false, true, 2s);
m_ctx = new PlayerContext("VideoPerformanceTest");
auto *mp = new MythPlayerUI(GetMythMainWindow(), nullptr, m_ctx, static_cast<PlayerFlags>(kAudioMuted | (m_allowGpu ? kDecodeAllowGPU: kNoFlags)));
mp->GetAudio()->SetAudioInfo("NULL", "NULL", 0, 0);
Expand Down
4 changes: 2 additions & 2 deletions mythtv/programs/mythbackend/filetransfer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#include "mythlogging.h"

FileTransfer::FileTransfer(QString &filename, MythSocket *remote,
bool usereadahead, int timeout_ms) :
bool usereadahead, std::chrono::milliseconds timeout) :
ReferenceCounter(QString("FileTransfer:%1").arg(filename)),
m_rbuffer(MythMediaBuffer::Create(filename, false, usereadahead, timeout_ms, true)),
m_rbuffer(MythMediaBuffer::Create(filename, false, usereadahead, timeout, true)),
m_sock(remote)
{
m_pginfo = new ProgramInfo(filename);
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythbackend/filetransfer.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class FileTransfer : public ReferenceCounter

public:
FileTransfer(QString &filename, MythSocket *remote,
bool usereadahead, int timeout_ms);
bool usereadahead, std::chrono::milliseconds timeout);
FileTransfer(QString &filename, MythSocket *remote, bool write);

MythSocket *getSocket() { return m_sock; }
Expand Down
4 changes: 2 additions & 2 deletions mythtv/programs/mythbackend/mainserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1945,15 +1945,15 @@ void MainServer::HandleAnnounce(QStringList &slist, QStringList commands,
FileTransfer *ft = nullptr;
bool writemode = false;
bool usereadahead = true;
int timeout_ms = 2000;
std::chrono::milliseconds timeout_ms = 2s;
if (commands.size() > 3)
writemode = (commands[3].toInt() != 0);

if (commands.size() > 4)
usereadahead = (commands[4].toInt() != 0);

if (commands.size() > 5)
timeout_ms = commands[5].toInt();
timeout_ms = std::chrono::milliseconds(commands[5].toInt());

if (writemode)
{
Expand Down