--- libs/libmythtv/NuppelVideoPlayer.cpp	2010-04-15 08:35:05.000000000 +0200
+++ libs/libmythtv/NuppelVideoPlayer.cpp	2010-04-23 15:25:32.000000000 +0200
@@ -254,6 +254,11 @@ NuppelVideoPlayer::NuppelVideoPlayer(boo
     for (int i = 0; i < MAXTBUFFER; i++)
         txtbuffers[i].buffer = new unsigned char[text_size + 1];
 
+	// Read the global audio sync (lipsync) settings
+	db_audio_sync = gCoreContext->GetNumSettingOnHost("AudioSync", gCoreContext->GetHostName(), 0);
+	VERBOSE(VB_IMPORTANT, LOC_ERR + QString("Saved audio timecode offset of %1").arg(db_audio_sync));
+	SaveAudioTimecodeOffset(db_audio_sync);
+
     memset(&CC708DelayedDeletes, 0, sizeof(CC708DelayedDeletes));
 }
 
@@ -4666,7 +4671,7 @@ void NuppelVideoPlayer::ClearAfterSeek(b
     if (savedAudioTimecodeOffset)
     {
         tc_wrap[TC_AUDIO] = savedAudioTimecodeOffset;
-        savedAudioTimecodeOffset = 0;
+        //savedAudioTimecodeOffset = 0;
     }
 
     SetPrebuffering(true);
--- libs/libmythtv/NuppelVideoPlayer.h	2010-03-09 01:33:51.000000000 +0100
+++ libs/libmythtv/NuppelVideoPlayer.h	2010-04-23 15:26:07.000000000 +0200
@@ -804,6 +804,7 @@ class MPUBLIC NuppelVideoPlayer : public
     float      m_stored_audio_stretchfactor;
     bool       audio_paused;
     int        repeat_delay;
+	long long	db_audio_sync;
 
     // Audio warping stuff
     float      warpfactor;
--- libs/libmythtv/tv_play.cpp	2010-04-08 16:36:03.000000000 +0200
+++ libs/libmythtv/tv_play.cpp	2010-04-23 15:21:45.000000000 +0200
@@ -8292,7 +8292,7 @@ void TV::ToggleUpmix(PlayerContext *ctx)
 // dir in 10ms jumps
 void TV::ChangeAudioSync(PlayerContext *ctx, int dir, bool allowEdit)
 {
-    long long newval;
+    long long newval = 0;
 
     ctx->LockDeleteNVP(__FILE__, __LINE__);
     if (!ctx->nvp)
@@ -8301,9 +8301,18 @@ void TV::ChangeAudioSync(PlayerContext *
         return;
     }
 
+    VERBOSE(VB_PLAYBACK, LOC + QString("ChangeAudioSync (%1, %2)")
+            .arg(audiosyncBaseline)
+            .arg(audiosyncAdjustment));
+
     if (!audiosyncAdjustment && LONG_LONG_MIN == audiosyncBaseline)
         audiosyncBaseline = ctx->nvp->GetAudioTimecodeOffset();
 
+    VERBOSE(VB_PLAYBACK, LOC + QString("ChangeAudioSync (%1, %2, %3)")
+            .arg(audiosyncBaseline)
+            .arg(audiosyncAdjustment)
+            .arg(dir));
+
     audiosyncAdjustment = allowEdit;
 
     if (dir == 1000000)
@@ -8318,17 +8327,21 @@ void TV::ChangeAudioSync(PlayerContext *
                  audiosyncBaseline;
         audiosyncBaseline = ctx->nvp->GetAudioTimecodeOffset();
     }
-    else
+    else if (dir != 0)
     {
         newval = ctx->nvp->AdjustAudioTimecodeOffset(dir*10) -
                  audiosyncBaseline;
     }
+
+    VERBOSE(VB_PLAYBACK, LOC + QString("ChangeAudioSync - newval: %1")
+            .arg(newval));
+
     ctx->UnlockDeleteNVP(__FILE__, __LINE__);
 
     OSD *osd = GetOSDLock(ctx);
     if (osd && !browsemode)
     {
-        QString text = QString(" %1 ms").arg(newval);
+        QString text = QString(" %1 ms (+ %2 ms)").arg(newval).arg(audiosyncBaseline);
         int val = (int)newval;
         if (dir == 1000000 || dir == -1000000)
         {
--- programs/mythfrontend/globalsettings.cpp	2010-04-04 17:28:25.000000000 +0200
+++ programs/mythfrontend/globalsettings.cpp	2010-04-23 15:31:14.000000000 +0200
@@ -88,6 +88,15 @@ static HostComboBox *AudioOutputDevice()
     return gc;
 }
 
+static HostSpinBox *AudioSync()
+{
+    HostSpinBox *gs = new HostSpinBox("AudioSync", -1600, 1600, 8, true);
+    gs->setLabel(QObject::tr("Audio sync offset"));
+    gs->setValue(0);
+    gs->setHelpText(QObject::tr("The global offset for audio synchronization (Lipsync)"));
+    return gs;
+}
+
 static HostComboBox *MaxAudioChannels()
 {
     HostComboBox *gc = new HostComboBox("MaxChannels",false);
@@ -3441,6 +3450,7 @@ static ConfigurationGroup *AudioSystemSe
     vcg->setUseLabel(false);
 
     vcg->addChild(new AudioOutputDevice());
+    vcg->addChild(AudioSync());
 
     Setting *numchannels = MaxAudioChannels();
     vcg->addChild(numchannels);
