JuliaIO / VideoIO.jl

Reading and writing of video files in Julia via ffmpeg
https://juliaio.github.io/VideoIO.jl/stable
Other
128 stars 53 forks source link

Replace sigatomic_(begin|end) with disable_sigint() do ... end #372

Closed mrufsvold closed 2 years ago

mrufsvold commented 2 years ago

Based on this issue, I switched out all of the uses of sigatomic with disable_sigint. Because the functions are now wrapped in a do block, I had to define ret as a Ref{Int32} outside the block to make it accessible to the error catches.

I tested load(), get_number_frames(), and get_duration() both in the REPL and using the VSCode debugger. They all worked in both cases now.

I'm not sure if there are other tests that should be run, but hopefully, someone more knowledgeable about this package and verify all is well!

codecov[bot] commented 2 years ago

Codecov Report

Merging #372 (32e3e2d) into master (7c8cc7f) will increase coverage by 0.37%. The diff coverage is 86.66%.

@@            Coverage Diff             @@
##           master     #372      +/-   ##
==========================================
+ Coverage   78.61%   78.99%   +0.37%     
==========================================
  Files          10       10              
  Lines        1253     1209      -44     
==========================================
- Hits          985      955      -30     
+ Misses        268      254      -14     
Impacted Files Coverage Δ
src/VideoIO.jl 18.18% <ø> (ø)
src/avio.jl 76.35% <80.00%> (-0.08%) :arrow_down:
src/encoding.jl 93.17% <100.00%> (-0.17%) :arrow_down:
src/frame_graph.jl 99.20% <100.00%> (-0.03%) :arrow_down:
src/avptr.jl 69.23% <0.00%> (-0.34%) :arrow_down:
src/avdictionary.jl 0.00% <0.00%> (ø)
src/avframe_transfer.jl 84.00% <0.00%> (+2.13%) :arrow_up:
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7c8cc7f...32e3e2d. Read the comment docs.

mrufsvold commented 2 years ago

Addressed your feedback! I didn't think about the fact that do blocks return the last line. Thanks for that!

IanButterworth commented 2 years ago

There seems to be a problem with nightly. Adding 1.8-nightly to evaluate.

I'll merge either way and fix on another PR