From b03286b7d56662c4a97e95ca0963a28a7672886b Mon Sep 17 00:00:00 2001 From: Stephen von Takach Date: Sun, 2 Jul 2023 22:51:29 +1000 Subject: [PATCH] fix(video): ensure channels closed if stream ends --- shard.yml | 2 +- src/ffmpeg/video.cr | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/shard.yml b/shard.yml index ffcd549..04014a1 100644 --- a/shard.yml +++ b/shard.yml @@ -1,5 +1,5 @@ name: ffmpeg -version: 0.5.0 +version: 0.5.1 dependencies: # we use stumpy to extract each pixels colour and draw bounding boxes diff --git a/src/ffmpeg/video.cr b/src/ffmpeg/video.cr index 818f043..7e2a976 100644 --- a/src/ffmpeg/video.cr +++ b/src/ffmpeg/video.cr @@ -131,6 +131,8 @@ abstract class FFmpeg::Video end rescue Channel::ClosedError ensure + ready.close + data.close close @format = Format.new GC.collect