Ticket #7772: mythtv-audiosync-0.22.patch
File mythtv-audiosync-0.22.patch, 4.2 KB (added by , 14 years ago) |
---|
-
libs/libmythtv/NuppelVideoPlayer.cpp
300 300 text_size = 8 * (sizeof(teletextsubtitle) + VT_WIDTH); 301 301 for (int i = 0; i < MAXTBUFFER; i++) 302 302 txtbuffers[i].buffer = new unsigned char[text_size + 1]; 303 304 // Read the global audio sync (lipsync) settings 305 db_audio_sync = gContext->GetNumSettingOnHost( 306 "AudioSync", gContext->GetHostName(), 0); 307 308 VERBOSE(VB_IMPORTANT, LOC_ERR + QString("Saved audio timecode offset of %1").arg(db_audio_sync)); 309 SaveAudioTimecodeOffset(db_audio_sync); 303 310 } 304 311 305 312 NuppelVideoPlayer::~NuppelVideoPlayer(void) … … 4902 4909 if (savedAudioTimecodeOffset) 4903 4910 { 4904 4911 tc_wrap[TC_AUDIO] = savedAudioTimecodeOffset; 4905 savedAudioTimecodeOffset = 0;4912 //savedAudioTimecodeOffset = 0; 4906 4913 } 4907 4914 4908 4915 SetPrebuffering(true); -
libs/libmythtv/NuppelVideoPlayer.h
807 807 bool decode_extra_audio; 808 808 float m_stored_audio_stretchfactor; 809 809 bool audio_paused; 810 long long db_audio_sync; 810 811 811 812 // Audio warping stuff 812 813 bool usevideotimebase; -
libs/libmythtv/tv_play.cpp
8110 8110 // dir in 10ms jumps 8111 8111 void TV::ChangeAudioSync(PlayerContext *ctx, int dir, bool allowEdit) 8112 8112 { 8113 long long newval ;8113 long long newval = 0; 8114 8114 8115 8115 ctx->LockDeleteNVP(__FILE__, __LINE__); 8116 8116 if (!ctx->nvp) … … 8119 8119 return; 8120 8120 } 8121 8121 8122 VERBOSE(VB_PLAYBACK, LOC + QString("ChangeAudioSync (%1, %2)") 8123 .arg(audiosyncBaseline) 8124 .arg(audiosyncAdjustment)); 8125 8122 8126 if (!audiosyncAdjustment && LONG_LONG_MIN == audiosyncBaseline) 8123 8127 audiosyncBaseline = ctx->nvp->GetAudioTimecodeOffset(); 8124 8128 8129 VERBOSE(VB_PLAYBACK, LOC + QString("ChangeAudioSync (%1, %2, %3)") 8130 .arg(audiosyncBaseline) 8131 .arg(audiosyncAdjustment) 8132 .arg(dir)); 8133 8125 8134 audiosyncAdjustment = allowEdit; 8126 8135 8127 8136 if (dir == 1000000) … … 8136 8145 audiosyncBaseline; 8137 8146 audiosyncBaseline = ctx->nvp->GetAudioTimecodeOffset(); 8138 8147 } 8139 else 8148 else if (dir != 0) 8140 8149 { 8141 8150 newval = ctx->nvp->AdjustAudioTimecodeOffset(dir*10) - 8142 8151 audiosyncBaseline; 8143 8152 } 8153 8154 VERBOSE(VB_PLAYBACK, LOC + QString("ChangeAudioSync - newval: %1") 8155 .arg(newval)); 8156 8144 8157 ctx->UnlockDeleteNVP(__FILE__, __LINE__); 8145 8158 8146 8159 OSD *osd = GetOSDLock(ctx); 8147 8160 if (osd && !browsemode) 8148 8161 { 8149 QString text = QString(" %1 ms ").arg(newval);8162 QString text = QString(" %1 ms (+ %2 ms)").arg(newval).arg(audiosyncBaseline); 8150 8163 int val = (int)newval; 8151 8164 if (dir == 1000000 || dir == -1000000) 8152 8165 { -
programs/mythfrontend/globalsettings.cpp
2701 2701 2702 2702 static HostCheckBox *UseFixedWindowSize() 2703 2703 { 2704 {2705 2704 HostCheckBox *gc = new HostCheckBox("UseFixedWindowSize"); 2706 2705 gc->setLabel(QObject::tr("Use fixed window size")); 2707 2706 gc->setValue(true); … … 2710 2709 "window can be resized")); 2711 2710 return gc; 2712 2711 } 2712 2713 static HostSpinBox *AudioSync() 2714 { 2715 HostSpinBox *gs = new HostSpinBox("AudioSync", -1600, 1600, 8, true); 2716 gs->setLabel(QObject::tr("Audio sync offset")); 2717 gs->setValue(0); 2718 gs->setHelpText(QObject::tr("The global offset for audio synchronization (Lipsync)")); 2719 return gs; 2713 2720 } 2714 2721 2715 2722 … … 3420 3427 setUseLabel(false); 3421 3428 3422 3429 addChild(AudioOutputDevice()); 3430 addChild(AudioSync()); 3423 3431 addChild(PassThroughOutputDevice()); 3424 3432 3425 3433 addChild(MaxAudioChannels());