Commit Graph

8 Commits

Author SHA1 Message Date
Tim Eisele ed61acc19a Fix subtitle encoding for local files (#17281)
* Fix subtitle encoding

* Add short-circuit

* Use IsTextFormat

* Update MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs

Co-authored-by: Bond-009 <bond.009@outlook.com>

---------

Co-authored-by: Bond-009 <bond.009@outlook.com>
2026-07-21 14:52:59 +02:00
Piotr Niełacny 6e3c187493 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.
2026-07-15 14:55:55 +02:00
Bond_009 03b6adf068 Fix xUnit1030: Do not call ConfigureAwait in test method 2023-09-18 17:55:52 +02:00
Bond-009 81c8890b6d Fix all warnings in MediaBrowser.MediaEncoding (#9073) 2023-01-11 17:22:01 -07:00
Cody Robibero 6004060b4e Fix build errors from new warnings 2022-09-09 07:44:14 -06:00
KonH b6bf43af45 Fix warning: Using directive is not required by the code and can be safely removed (#2149) 2021-10-03 10:49:41 +07:00
Bond_009 b0194bce6c Add regression test for issue #5168 2021-09-18 15:31:45 +02:00
Bond_009 34b38454e0 Fix SubtitleEncoder and add regression tests 2021-09-18 15:23:55 +02:00