https://bugs.kde.org/show_bug.cgi?id=461995
Bug ID: 461995 Summary: Time of day stripped from subtitles on load Classification: Applications Product: kdenlive Version: 22.08.3 Platform: Other OS: Linux Status: REPORTED Severity: normal Priority: NOR Component: Effects & Transitions Assignee: vpi...@kde.org Reporter: bill.smith14...@proton.me Target Milestone: --- SUMMARY *** NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols. See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports *** STEPS TO REPRODUCE 1. Add subtitle with the text /d:/d/d (e.g. a time like 4:15) 2. Save 3. Delete subtitle 4. Reload subtitles OBSERVED RESULT Any subtitle with characters matching regex ([0-9]{1,2}):([0-9]{2}) is ignored. (code treats lines that contain this regex as times on the timeline rather than text to be rendered. This means that you can't have a subtitle that contains the time of day, for example) EXPECTED RESULT Presumably kdenlive should render any subtitle that contains printable characters. SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: Linux 5.15.0-53-generic #59-Ubuntu SMP Mon Oct 17 18:53:30 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux (available in About System) KDE Plasma Version: KDE Frameworks Version: 5.92.0 Qt Version: 5.15.3 ADDITIONAL INFORMATION The issue occurs in subtitlemodel.cpp commit SHA 81d3e6610c9998f56dbbba80a37807fa7bd5b6c2 line 201 https://invent.kde.org/multimedia/kdenlive/-/blob/d592484a4e2dac7c723bc8ad088f8ac33fb63183/src/bin/model/subtitlemodel.cpp#L201 where QRegularExpression rx("([0-9]{1,2}):([0-9]{2})") is used as a criterion for identifying a line of the srt file as being a timecode line for the subtitle. This is too general a criterion in that it prevents users from having subtitles containing the time of day for example. I don't have experience with .srt files (in terms of how major software packages are conforming to the 'standard') but judging by the srt file spec, if you multiline match (\d+)\n(\d\d:\d\d:\d\d),(\d+) --> (\d\d:\d\d:\d\d),(\d+)\n(.*)\n\n[EOF|(\d+)\n(\d\d:\d\d:\d\d),(\d+) --> (\d\d:\d\d:\d\d),(\d+)\n or something like this, then (.*) would allow the user to render most printable text (after making sure that everything in (.*) is actually renderable) -- everything except something that looked like the first two lines of a subtitle entry in an srt file. -- You are receiving this mail because: You are watching all bug changes.