0

I've implemented a player in my WPF app and used LibVLCSharp library. Everything is working as expected except 1 thing. To delay the subtitles.

I'm using MediaPlayer.SetSpuDelay(400) method from the library, it returns true (meaning, it says it worked). However, when I see the subtitle it is not actually delayed.

I even tried increasing the delay value to 6000 (6 secs.) but no luck! :(

Here is my method which I'm using to delay the subs:

public void SeekSubtitle(bool doPositiveSync)
{
      int _subtitleDelay = 0;
      MediaPlayer _mp = VideoView.MediaPlayer;

      //Negative value increase the timing of subtitle delay.
      if (doPositiveSync)
           _subtitleDelay += 1000;
      else
           _subtitleDelay -= 1000;
    
      var result = _mp.SetSpuDelay(_subtitleDelay);
}
                

Kindly suggest what I'm missing here as this is crucial part of the app.

Thanks. :)

Mayur Paghdal
  • 275
  • 1
  • 2
  • 12
  • Please open an issue with a minimal reproducible project hosted on github or similar. it is possible that the feature has never been tested, but I doubt it's only WPF-specific – cube45 Jun 09 '22 at 17:47

1 Answers1

0

Okay. So, I got the solution byself.

I was adding the value in form of Milliseconds. SetSpuDelay() requires value in MICROSECONDS.

I had to add +/- 100000 to adjust subtitle.

Mayur Paghdal
  • 275
  • 1
  • 2
  • 12