  }
  
  static int
-@@ -801,6 +1081,16 @@
+@@ -801,6 +841,16 @@
  {
      VFSVorbisFile *handle = (VFSVorbisFile *) datasource;
  

     return aud_vfs_fseek(handle->fd, offset, whence);
 }
 
@@ -813,6 +1103,12 @@
 
     if (handle->probe == FALSE)
     {
+#ifdef HAVE_KATE
+        if (g_mutex_trylock(kate_mutex)) {
+            shutdown_kate(&handle->aks);
+            g_mutex_unlock(kate_mutex);
+        }
+#endif

     g_mutex_lock(vf_mutex);
+
+#ifdef HAVE_KATE
+    aud_kate_setup(&fd->aks, &vorbis_ip);
+#endif
+   
     if (ov_open_callbacks(datasource, &vf, NULL, 0, aud_vfs_is_streaming(fd->fd) ? vorbis_callbacks_stream : vorbis_callbacks) < 0) {
         vorbis_callbacks.close_func(datasource);
         g_mutex_unlock(vf_mutex);
@@ -430,6 +441,11 @@
             last_section = current_section;
          
         }
+
+#ifdef HAVE_KATE
+        aud_kate_update_lyrics(&fd->aks, playback, title);
+#endif
+
     } /* main loop */
 
     if (!playback->error) {
@@ -620,7 +636,11 @@
      * machine initialization.  If it returns zero, the stream
      * *is* Vorbis and we're fully ready to decode.
      */
