Skip to content

Commit

Permalink
Use separate end-of-playback checks for audio-only/mostly content and
Browse files Browse the repository at this point in the history
normal/video-only content.

Fixes #511

Signed-off-by: David Engel <dengel@mythtv.org>
  • Loading branch information
ulmus-scott authored and gigem committed Mar 11, 2022
1 parent 5e15c23 commit 3675395
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions mythtv/libs/libmythtv/mythplayerui.cpp
Expand Up @@ -243,13 +243,23 @@ void MythPlayerUI::EventLoop()
return;
}

bool videoDrained =
m_videoOutput && m_videoOutput->ValidVideoFrames() < 1;
bool audioDrained =
!m_audio.GetAudioOutput() ||
m_audio.IsPaused() ||
m_audio.GetAudioOutput()->GetAudioBufferedTime() < 100ms;
if (eof != kEofStateDelayed || (videoDrained && audioDrained))
bool drained = false;
if (FlagIsSet(kVideoIsNull) || FlagIsSet(kMusicChoice))
{
// We have audio only or mostly audio content. Exit when
// the audio is drained.
drained =
!m_audio.GetAudioOutput() ||
m_audio.IsPaused() ||
m_audio.GetAudioOutput()->GetAudioBufferedTime() < 100ms;
}
else
{
// We have normal or video only content. Exit when the
// video is drained.
drained = m_videoOutput && !m_videoOutput->ValidVideoFrames();
}
if (eof != kEofStateDelayed || drained)
{
if (eof == kEofStateDelayed)
{
Expand Down

1 comment on commit 3675395

@Jpilk
Copy link

@Jpilk Jpilk commented on 3675395 Mar 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this and other commits onwards from c032b28 the process of creating a cutlist for DVB-T radio recordings seems much less likely to have problems. I do still see unexpected 20-second hangups, with both radio and TV recordings, but it's much better than it has been, with occasional possible hints of improvement, since around Nov 2020. Thanks! Issue #344.

Please sign in to comment.