fix: enforce LC_ALL=C locale and sanitize chapter timestamp ordering - #24
Open
niStee wants to merge 1 commit into
Open
fix: enforce LC_ALL=C locale and sanitize chapter timestamp ordering#24niStee wants to merge 1 commit into
niStee wants to merge 1 commit into
Conversation
- Enforce LC_ALL=C to ensure POSIX float parsing in ftoi() across European and non-C locales. - Sanitize chapter start/end timestamps and chronological ordering in build_options() so corrupted or inverted community metadata (e.g. ed_start < op_end) is filtered out rather than generating broken ffmetadata files.
Owner
|
Thanks for the PR, I will test and merge it this weekend. |
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.
Closes #23
Summary
This PR resolves two related bugs encountered during video playback with
ani-skipandmpv:de_DE.UTF-8,fr_FR.UTF-8),printf "%.3f"inftoi()failed when parsing decimal-dot JSON floats (printf: 151.02: invalid number).ed_start < op_end) previously produced out-of-order chapter files that causedmpv's ffmpeg demuxer to reject the chapter file withChapter end time ... before start ...and failavformat_open_input().Changes
export LC_ALL=C: Ensures POSIX-standard decimal float formatting, regex, and string transformations regardless of host locale environment.build_options():start_time < end_timefor both Opening and Ending intervals.ed_start >= op_end). If corrupted, the anomalous segment is safely ignored rather than crashing the metadata demuxer.Opening->Episode->Ending).Verification
Tested with
LC_ALL=de_DE.UTF-8across: