Repository navigation
fix: keep SRT text after blank lines, convert sidecar subtitles to UTF-8 and notify failures once - #13
Merged
Conversation
The sidecar parser split files on blank lines and treated each block as a cue, so an SRT cue whose text contained an empty line lost everything after it. In SRT a block without a timing line now continues the previous cue, and a block after a cue with an invalid timing line is dropped with it. WebVTT keeps ending a cue at a blank line, so NOTE, STYLE and REGION blocks between cues are still skipped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Since the hook started handing read-class takeover failures to Plex as a Shaka network error, a read failure after ready showed both the s1002 dialog and the in-video interruption notice. Decode and format failures after ready, which the hook hands to Plex as a media error, did the same. The host no longer shows the interruption notice on its own after ready. The hook knows whether Plex's player actually received an error event and replies with takeover-error-unsurfaced when it did not, because the failure code has no Plex error surface, the Shaka error factory is missing, or dispatching threw. Only then does the host show its notice, so playback never stalls silently. Nothing is reported when Plex has already started another load or for the media_detached stop code. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sidecar subtitles were requested without an encoding and decoded as UTF-8, which relied on a reverse proxy in front of Plex converting them. GBK or Big5 files it could not identify, or any non-UTF-8 file served by Plex directly, showed as mojibake. The request now carries encoding=utf-8. Plex Media Server then detects the file encoding itself and converts it to UTF-8, and a proxy that forwards the query keeps working because it receives valid UTF-8. When Plex cannot convert either, the file is reported as an unsupported encoding instead of drawn as mojibake. The text counts as undecodable when it holds at least 4 replacement characters and they make up at least half of its non-ASCII characters. GBK and Big5 decoded as UTF-8 turn over 90% of their non-ASCII characters into replacement characters, so a mostly English file with a few garbled CJK words is still caught, while a stray bad byte in a small or a mostly valid UTF-8 file is not. The architecture document describes the new request and fallback. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The leading-picture filter claimed the codec guarantees that pictures after the random access point never reference the dropped leading pictures. That holds for HEVC CRA, whose trailing pictures may not reference RASL or RADL pictures, but H.264 recovery-point I frames carry no such constraint, so a later picture can reference a dropped leading reference picture and decode with brief artifacts until the next random access point. The comment now says so and why the same rule still applies: kept leading pictures are undecodable at the start key and rejected by the muxer mid-stream. Behavior is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
0.0.5 之后发现三处问题。
结果
encoding=utf-8,由 Plex 识别并转换编码。Plex 也转不了时(替换字符不少于 4 个且占非 ASCII 字符一半以上)提示编码暂不支持,视频照常播放。takeover-error-unsurfaced,由宿主显示中断提示,不会静默卡住。验证
pnpm build、pnpm typecheck、pnpm lint、pnpm test(422 passed)、git diff --check均通过。🤖 Generated with Claude Code