Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rename the player eof variable.

...and make it clear that it is the decoder that has hit the end of file
state and not the ringbuffer.
(cherry picked from commit 985f38a)
  • Loading branch information...
commit 95ecfdbd17c0f7b99244b2cf59baa3af96371a4e 1 parent efe64a4
Mark Kendall authored
View
2  mythtv/libs/libmythtv/mythcommflagplayer.cpp
@@ -108,7 +108,7 @@ bool MythCommFlagPlayer::RebuildSeekTable(
fflush( stdout );
}
- while (!eof)
+ while (!decoderEof)
{
if (inuse_timer.elapsed() > 2534)
{
View
42 mythtv/libs/libmythtv/mythplayer.cpp
@@ -130,13 +130,12 @@ MythPlayer::MythPlayer(bool muted)
parentWidget(NULL), embedid(0),
embx(-1), emby(-1), embw(-1), embh(-1),
// State
+ decoderEof(false),
decoderPaused(false), pauseDecoder(false), unpauseDecoder(false),
killdecoder(false), decoderSeek(-1), decodeOneFrame(false),
needNewPauseFrame(false),
bufferPaused(false), videoPaused(false),
allpaused(false), playing(false),
-
- eof(false),
m_double_framerate(false), m_double_process(false),
m_can_double(false), m_deint_possible(true),
livetv(false),
@@ -963,7 +962,7 @@ int MythPlayer::OpenFile(uint retries, bool allow_libmpeg2)
//noVideoTracks = !decoder->GetTrackCount(kTrackTypeVideo);
- eof = false;
+ decoderEof = false;
// Set 'no_video_decode' to true for audio only decodeing
bool no_video_decode = false;
@@ -2182,7 +2181,7 @@ void MythPlayer::SwitchToProgram(void)
{
OpenDummy();
ResetPlaying();
- eof = false;
+ decoderEof = false;
delete pginfo;
return;
}
@@ -2196,21 +2195,21 @@ void MythPlayer::SwitchToProgram(void)
QString("(card type: %1).")
.arg(player_ctx->tvchain->GetCardType(newid)));
VERBOSE(VB_IMPORTANT, QString("\n") + player_ctx->tvchain->toString());
- eof = true;
+ decoderEof = true;
SetErrored(QObject::tr("Error opening switch program buffer"));
delete pginfo;
return;
}
- if (eof)
+ if (decoderEof)
{
discontinuity = true;
ResetCaptions();
}
VERBOSE(VB_PLAYBACK, LOC + QString("SwitchToProgram(void) "
- "discont: %1 newtype: %2 newid: %3 eof: %4")
- .arg(discontinuity).arg(newtype).arg(newid).arg(eof));
+ "discont: %1 newtype: %2 newid: %3 decoderEof: %4")
+ .arg(discontinuity).arg(newtype).arg(newid).arg(decoderEof));
if (discontinuity || newtype)
{
@@ -2240,7 +2239,7 @@ void MythPlayer::SwitchToProgram(void)
if (IsErrored())
{
VERBOSE(VB_IMPORTANT, LOC_ERR + "SwitchToProgram failed.");
- eof = true;
+ decoderEof = true;
return;
}
@@ -2255,7 +2254,7 @@ void MythPlayer::SwitchToProgram(void)
forcePositionMapSync = true;
}
- eof = false;
+ decoderEof = false;
Play();
VERBOSE(VB_PLAYBACK, LOC + "SwitchToProgram - end");
}
@@ -2272,7 +2271,7 @@ void MythPlayer::FileChangedCallback(void)
player_ctx->buffer->Reset(false, true, true);
Play();
- eof = false;
+ decoderEof = false;
player_ctx->SetPlayerChangingBuffers(false);
@@ -2310,7 +2309,7 @@ void MythPlayer::JumpToProgram(void)
{
OpenDummy();
ResetPlaying();
- eof = false;
+ decoderEof = false;
delete pginfo;
return;
}
@@ -2327,7 +2326,7 @@ void MythPlayer::JumpToProgram(void)
.arg(player_ctx->tvchain->GetCardType(newid)));
VERBOSE(VB_IMPORTANT, QString("\n") + player_ctx->tvchain->toString());
- eof = true;
+ decoderEof = true;
SetErrored(QObject::tr("Error opening jump program file buffer"));
delete pginfo;
return;
@@ -2371,7 +2370,7 @@ void MythPlayer::JumpToProgram(void)
if (nextpos > 10)
DoFastForward(nextpos, true, false);
- eof = false;
+ decoderEof = false;
player_ctx->SetPlayerChangingBuffers(false);
VERBOSE(VB_PLAYBACK, LOC + "JumpToProgram - end");
}
@@ -2494,7 +2493,7 @@ void MythPlayer::EventLoop(void)
player_ctx->tvchain->JumpToNext(true, 1);
JumpToProgram();
}
- else if ((!allpaused || eof) && player_ctx->tvchain &&
+ else if ((!allpaused || decoderEof) && player_ctx->tvchain &&
(decoder && !decoder->GetWaitForChange()))
{
// Switch to the next program in livetv
@@ -2545,7 +2544,7 @@ void MythPlayer::EventLoop(void)
}
// Handle end of file
- if (eof)
+ if (decoderEof)
{
if (player_ctx->tvchain)
{
@@ -2578,7 +2577,7 @@ void MythPlayer::EventLoop(void)
if (fftime > 0)
{
DoFastForward(fftime);
- if (eof)
+ if (decoderEof)
return;
}
}
@@ -2640,7 +2639,7 @@ void MythPlayer::EventLoop(void)
&& !player_ctx->IsPIP() &&
player_ctx->GetState() == kState_WatchingPreRecorded))
{
- eof = true;
+ decoderEof = true;
}
}
else
@@ -2782,7 +2781,8 @@ void MythPlayer::DecoderLoop(bool pause)
decoder_change_lock.unlock();
}
- bool obey_eof = eof && !(eof && player_ctx->tvchain && !allpaused);
+ bool obey_eof = decoderEof &&
+ !(decoderEof && player_ctx->tvchain && !allpaused);
if (isDummy || ((decoderPaused || ffrew_skip == 0 || obey_eof) &&
!decodeOneFrame))
{
@@ -4117,7 +4117,7 @@ bool MythPlayer::TranscodeGetNextFrame(
if (!decoder->GetFrame(kDecodeAV))
return false;
- if (eof)
+ if (decoderEof)
return false;
if (honorCutList && !deleteMap.IsEmpty())
@@ -4142,7 +4142,7 @@ bool MythPlayer::TranscodeGetNextFrame(
did_ff = 1;
}
}
- if (eof)
+ if (decoderEof)
return false;
is_key = decoder->isLastFrameKey();
return true;
View
6 mythtv/libs/libmythtv/mythplayer.h
@@ -124,7 +124,7 @@ class MPUBLIC MythPlayer
void SetLength(int len) { totalLength = len; }
void SetFramesPlayed(uint64_t played) { framesPlayed = played; }
void SetVideoFilters(const QString &override);
- void SetEof(void) { eof = true; }
+ void SetEof(void) { decoderEof = true; }
void SetPIPActive(bool is_active) { pip_active = is_active; }
void SetPIPVisible(bool is_visible) { pip_visible = is_visible; }
@@ -174,7 +174,7 @@ class MPUBLIC MythPlayer
// Bool Gets
bool GetRawAudioState(void) const;
bool GetLimitKeyRepeat(void) const { return limitKeyRepeat; }
- bool GetEof(void) const { return eof; }
+ bool GetEof(void) const { return decoderEof; }
bool IsErrored(void) const;
bool IsPlaying(uint wait_ms = 0, bool wait_for = true) const;
bool AtNormalSpeed(void) const { return next_normal_speed; }
@@ -530,6 +530,7 @@ class MPUBLIC MythPlayer
QWaitCondition decoderThreadUnpause;
mutable QMutex decoderPauseLock;
mutable QMutex decoderSeekLock;
+ bool decoderEof;
bool decoderPaused;
bool pauseDecoder;
bool unpauseDecoder;
@@ -548,7 +549,6 @@ class MPUBLIC MythPlayer
mutable QWaitCondition playingWaitCond;
mutable QMutex vidExitLock;
mutable QMutex playingLock;
- bool eof; ///< At end of file/ringbuffer
bool m_double_framerate;///< Output fps is double Video (input) rate
bool m_double_process;///< Output filter must processed at double rate
bool m_can_double; ///< VideoOutput capable of doubling frame rate
Please sign in to comment.
Something went wrong with that request. Please try again.