sachac / subed

subed is a subtitle editor for Emacs
177 stars 16 forks source link

High CPU load when playing through long gap between subtitles #14

Open rndusr opened 4 years ago

rndusr commented 4 years ago
How To Reproduce
  1. Place point on a subtitle that doesn't have a following subtitle for a few minutes.

  2. M-x subed-enable-sync-point-to-player

  3. Let the video play.

  4. After a while (tens of seconds in my case), CPU load on a single core spikes to 100%. Eventually, video playback becomes choppy and Emacs takes several seconds to respond to user input.

What I Know

The relevant code seems to be in subed-srt--subtitle-id-at-msecs, specifically in the final (catch 'subtitle-id ...). If I comment that out, the issue goes away, but I don't understand what's wrong with the code or how to investigate further.