Permalink
Browse files

MythPlayer: avoid pausing audio when dropping video frames due to tim…

…estretch.

This avoids pausing the audio when using timestretch and the avsync_predictor drops a frame.
  • Loading branch information...
1 parent 464e261 commit 98d3990602b1b068a60e5f32ccf740b4cfce23a6 @tralph tralph committed Jun 15, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 mythtv/libs/libmythtv/mythplayer.cpp
@@ -1682,6 +1682,7 @@ void MythPlayer::AVSync(VideoFrame *buffer, bool limit_delay)
if (kScan_Detect == m_scan || kScan_Ignore == m_scan)
ps = kScan_Progressive;
+ bool max_video_behind = diverge < -MAXDIVERGE;
bool dropframe = false;
QString dbg;
@@ -1700,7 +1701,7 @@ void MythPlayer::AVSync(VideoFrame *buffer, bool limit_delay)
}
}
- if (diverge < -MAXDIVERGE)
+ if (max_video_behind)
{
dropframe = true;
// If video is way behind of audio, adjust for it...
@@ -1720,7 +1721,7 @@ void MythPlayer::AVSync(VideoFrame *buffer, bool limit_delay)
lastsync = true;
currentaudiotime = AVSyncGetAudiotime();
VERBOSE(VB_PLAYBACK, LOC + dbg + "dropping frame to catch up.");
- if (!audio.IsPaused())
+ if (!audio.IsPaused() && max_video_behind)
{
audio.Pause(true);
avsync_audiopaused = true;

0 comments on commit 98d3990

Please sign in to comment.