diff --git a/mythtv/libs/libmythtv/mythplayer.cpp b/mythtv/libs/libmythtv/mythplayer.cpp
index 7f354bedecd..99e826e62b1 100644
a
|
b
|
void MythPlayer::AVSync(VideoFrame *buffer, bool limit_delay) |
1915 | 1915 | } |
1916 | 1916 | else |
1917 | 1917 | { |
1918 | | dropframe = true; |
| 1918 | dropframe = !FlagIsSet(kMusicChoice); |
1919 | 1919 | dbg = QString("A/V predict drop frame, refreshrate %1, avsync_predictor %2, diverge %3, ") |
1920 | 1920 | .arg(refreshrate).arg(avsync_predictor).arg(diverge); |
1921 | 1921 | } |
… |
… |
void MythPlayer::AVSync(VideoFrame *buffer, bool limit_delay) |
1923 | 1923 | |
1924 | 1924 | if (max_video_behind) |
1925 | 1925 | { |
1926 | | dropframe = true; |
| 1926 | dropframe = !FlagIsSet(kMusicChoice); |
1927 | 1927 | // If video is way behind of audio, adjust for it... |
1928 | 1928 | dbg = QString("Video is %1 frames behind audio (too slow), ") |
1929 | 1929 | .arg(-diverge); |
… |
… |
bool MythPlayer::PrebufferEnoughFrames(int min_buffers) |
2236 | 2236 | { |
2237 | 2237 | float current = ComputeSecs(framesPlayed, true); |
2238 | 2238 | float length = ComputeSecs(totalFrames, true); |
2239 | | if (length > current && length - current < 1.5) |
| 2239 | if (length > current && length - current < 1.5 |
| 2240 | && !FlagIsSet(kMusicChoice)) |
2240 | 2241 | { |
2241 | 2242 | LOG(VB_PLAYBACK, LOG_NOTICE, LOC + |
2242 | 2243 | QString("Pause to allow live tv catch up. Position in sec. Current: %2, Total: %3") |
… |
… |
bool MythPlayer::PrebufferEnoughFrames(int min_buffers) |
2249 | 2250 | usleep(frame_interval >> 3); |
2250 | 2251 | int waited_for = buffering_start.msecsTo(QTime::currentTime()); |
2251 | 2252 | int last_msg = buffering_last_msg.msecsTo(QTime::currentTime()); |
2252 | | if (last_msg > 100) |
| 2253 | if (last_msg > 100 && !FlagIsSet(kMusicChoice)) |
2253 | 2254 | { |
2254 | 2255 | if (++bufferingCounter == 10) |
2255 | 2256 | LOG(VB_GENERAL, LOG_NOTICE, LOC + |
… |
… |
bool MythPlayer::PrebufferEnoughFrames(int min_buffers) |
2263 | 2264 | QString("Waited %1ms for video buffers %2") |
2264 | 2265 | .arg(waited_for).arg(videoOutput->GetFrameStatus())); |
2265 | 2266 | buffering_last_msg = QTime::currentTime(); |
2266 | | // music choice only sends a frame every 6 seconds |
2267 | | // so wait 7 seconds before doing this reset |
2268 | | if (waited_for > 7000 && audio.IsBufferAlmostFull()) |
| 2267 | if (audio.GetAudioBufferedTime() > 2000 && framesPlayed < 5 |
| 2268 | && gCoreContext->GetNumSetting("MusicChoiceEnabled", 0)) |
| 2269 | { |
| 2270 | playerFlags = (PlayerFlags)(playerFlags | kMusicChoice); |
| 2271 | LOG(VB_GENERAL, LOG_NOTICE, LOC + |
| 2272 | "Music Choice program detected - disabling AV Sync."); |
| 2273 | } |
| 2274 | if (waited_for > 7000 && audio.IsBufferAlmostFull() |
| 2275 | && !FlagIsSet(kMusicChoice)) |
2269 | 2276 | { |
2270 | 2277 | // We are likely to enter this condition |
2271 | 2278 | // if the audio buffer was too full during GetFrame in AVFD |
diff --git a/mythtv/libs/libmythtv/mythplayer.h b/mythtv/libs/libmythtv/mythplayer.h
index fd4741e1db7..b6352005e37 100644
a
|
b
|
enum PlayerFlags |
99 | 99 | kVideoIsNull = 0x000100, |
100 | 100 | kAudioMuted = 0x010000, |
101 | 101 | kNoITV = 0x020000, |
| 102 | kMusicChoice = 0x040000, |
102 | 103 | }; |
103 | 104 | |
104 | 105 | #define FlagIsSet(arg) (playerFlags & arg) |
diff --git a/mythtv/programs/mythfrontend/globalsettings.cpp b/mythtv/programs/mythfrontend/globalsettings.cpp
index b3810d8b4a0..2e3ac3fe2f5 100644
a
|
b
|
static HostCheckBoxSetting *EndOfRecordingExitPrompt() |
1681 | 1681 | return gc; |
1682 | 1682 | } |
1683 | 1683 | |
| 1684 | static HostCheckBoxSetting *MusicChoiceEnabled() |
| 1685 | { |
| 1686 | HostCheckBoxSetting *gc = new HostCheckBoxSetting("MusicChoiceEnabled"); |
| 1687 | |
| 1688 | gc->setLabel(PlaybackSettings::tr("Enable Music Choice")); |
| 1689 | |
| 1690 | gc->setValue(false); |
| 1691 | |
| 1692 | gc->setHelpText(PlaybackSettings::tr("Enable this to improve playing of Music Choice channels " |
| 1693 | "or recordings from those channels. " |
| 1694 | "These are audio channels with slide show " |
| 1695 | "from some cable providers. " |
| 1696 | "In unusual situations this could cause lip sync problems " |
| 1697 | "watching normal videos or TV shows.")); |
| 1698 | return gc; |
| 1699 | } |
| 1700 | |
1684 | 1701 | static HostCheckBoxSetting *JumpToProgramOSD() |
1685 | 1702 | { |
1686 | 1703 | HostCheckBoxSetting *gc = new HostCheckBoxSetting("JumpToProgramOSD"); |
… |
… |
void PlaybackSettings::Load(void) |
4104 | 4121 | general->addChild(PIPLocationComboBox()); |
4105 | 4122 | general->addChild(PlaybackExitPrompt()); |
4106 | 4123 | general->addChild(EndOfRecordingExitPrompt()); |
| 4124 | general->addChild(MusicChoiceEnabled()); |
4107 | 4125 | addChild(general); |
4108 | 4126 | |
4109 | 4127 | m_playbackProfiles = CurrentPlaybackProfile(); |