Index: libs/libmyth/audiooutputbase.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmyth/audiooutputbase.cpp,v
retrieving revision 1.5
diff -a -u -r1.5 audiooutputbase.cpp
--- libs/libmyth/audiooutputbase.cpp	29 Nov 2004 23:13:33 -0000	1.5
+++ libs/libmyth/audiooutputbase.cpp	18 Dec 2004 11:41:33 -0000
@@ -303,10 +303,12 @@
 
     gettimeofday(&now, NULL);
 
-    ret = audiotime;
  
-    ret += (now.tv_sec - audiotime_updated.tv_sec) * 1000;
+    ret = (now.tv_sec - audiotime_updated.tv_sec) * 1000;
     ret += (now.tv_usec - audiotime_updated.tv_usec) / 1000;
+    ret = (int)(ret * audio_stretchfactor);
+
+    ret += audiotime;
 
     pthread_mutex_unlock(&avsync_lock);
     return ret;
@@ -347,8 +349,9 @@
     if (pSoundStretch)
     {
         // add the effect of unprocessed samples in time stretch algo
-        totalbuffer += (int)(pSoundStretch->numUnprocessedSamples() / 
-                             audio_stretchfactor);
+        totalbuffer += (int)((pSoundStretch->numUnprocessedSamples()*
+                                audio_bytes_per_sample) / 
+                                audio_stretchfactor);
     }
                
     audiotime = audbuf_timecode - (int)(totalbuffer * 100000.0 /
