aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Extensions
diff options
context:
space:
mode:
authorPiotr Niełacny <piotr.nielacny@gmail.com>2026-07-15 14:55:55 +0200
committerPiotr Niełacny <piotr.nielacny@gmail.com>2026-07-15 14:55:55 +0200
commit6e3c1874936b767754cd9267749f35b27f2ae65f (patch)
tree29570055389ab314bbb7b04908f7d8ab5db88d14 /MediaBrowser.Controller/Extensions
parentcfeaef61806525f85ad42f95961e1294a66e7944 (diff)
Fix race condition in concurrent subtitle conversion
SubtitleEncoder.ConvertSubtitles parsed subtitles with libse's static Subtitle.Parse, which iterates a statically cached list of shared SubtitleFormat instances. Format parsers keep mutable per-parse state on the instance, so concurrent subtitle requests corrupted each other's output (cues mixed across streams and languages, truncated files) or failed with NullReferenceException when format detection broke down and Subtitle.Parse returned null. Parse through the injected ISubtitleParser instead. SubtitleEditParser instantiates a fresh format parser per call, so requests no longer share state. Its Parse method now returns the libse Subtitle directly (the SubtitleTrackInfo flattening was unused since the SubtitleEdit writer rework) so the writers keep full fidelity such as ASS styling.
Diffstat (limited to 'MediaBrowser.Controller/Extensions')
0 files changed, 0 insertions, 0 deletions