Skip to content

Commit

Permalink
Avoid premature playback exit for audio-only recordings.
Browse files Browse the repository at this point in the history
Stop playback only when the decoder, video output, and audio output
all drain.  Refs #11357.  Refs #6974.
  • Loading branch information
stichnot committed Jul 5, 2013
1 parent 60f7ef7 commit cef316f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mythtv/libs/libmythtv/mythplayer.cpp
Expand Up @@ -62,6 +62,7 @@ using namespace std;
#include "mythlogging.h"
#include "mythmiscutil.h"
#include "icringbuffer.h"
#include "audiooutput.h"

extern "C" {
#include "vbitext/vbi.h"
Expand Down Expand Up @@ -2940,8 +2941,11 @@ void MythPlayer::EventLoop(void)
return;
}

if (eof != kEofStateDelayed ||
(videoOutput && videoOutput->ValidVideoFrames() < 1))
bool videoDrained =
videoOutput && videoOutput->ValidVideoFrames() < 1;
bool audioDrained =
audio.GetAudioOutput()->GetAudioBufferedTime() < 100;
if (eof != kEofStateDelayed || (videoDrained && audioDrained))
{
if (eof == kEofStateDelayed)
LOG(VB_PLAYBACK, LOG_INFO,
Expand Down

0 comments on commit cef316f

Please sign in to comment.