* Fix image encoding concurrency limit
The current FFmpeg image extractor is configured to use a resource pool size that always equals 2 times the number of CPU cores, which is somewhat excessive. Make the default equal to the core count instead of twice, and respect the `ParallelImageEncodingLimit` option.
* Fix code stype
* Check null value for unit tests
`SubtitleFormat`'s `LoadSubtitle()` function is
not thread-safe.
A `SubtitleEditParser` instance's `Parse()`
function can be called from multiple threads at
the same time.
`SubtitleFormat`s are cached in the constructor
of each `SubtitleEditParser`, and the same
instances are used for each possibly parallel
`Parse()` function call, which causes subtitle
parse problems.
This patch modifies the code, so we only cache
the extension -> `SubtitleFormat` type/class
mapping and create a new `SubtitleFormat`
instance in each `Parse()` call, so no
`SubtitleFormat` instance is accessed from
multiple threads.
Fixes#12113
Kudos for everyone investigating the issue there,
most notably @RenV123 for PoC-ing the solution.
Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
Create and use FormattingStreamWriter
Original-merge: cd2f2ca178
Merged-by: Bond-009 <bond.009@outlook.com>
Backported-by: Joshua M. Boniface <joshua@boniface.me>
This applies software tonemapx filter for dolby vision videos that have no compatability fallback.
Due to the complexity of the reshaping process, this is quite CPU-intensive. For real-time transcoding and tonemapping of 4K 60fps content, a CPU with 16 cores of Zen3-level performance is recommended.
Signed-off-by: gnattu <gnattuoc@me.com>
Check attachment path for null before use
Original-merge: 122da8f447
Merged-by: Bond-009 <bond.009@outlook.com>
Backported-by: Joshua M. Boniface <joshua@boniface.me>
Fix localization of audio title
Original-merge: f7a90b6383
Merged-by: Bond-009 <bond.009@outlook.com>
Backported-by: Joshua M. Boniface <joshua@boniface.me>