  int
  vcedit_write(vcedit_state * state, void *out)
  {
-@@ -321,7 +389,6 @@
+@@ -321,7 +395,6 @@
      int needflush = 0, needout = 0;
  
      state->eosin = 0;

 }
 
 static int
@@ -801,6 +1068,16 @@
 {
     VFSVorbisFile *handle = (VFSVorbisFile *) datasource;
 
+#ifdef HAVE_KATE
+    if (g_mutex_trylock(kate_mutex)) {
+        if (kate_init_state >= kis_sync) {
+            ogg_sync_reset(&ksy);
+        }
+        clear_lyrics_events();
+        g_mutex_unlock(kate_mutex);
+    }
+#endif

         return _fetch_next_packet(s, p, page);
     }
 }
@@ -200,6 +237,9 @@
     state->read = read_func;
     state->write = write_func;
 
