Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit d0c32125df2269621f0b6a85dabe36120a6d3f3b Merge: fea9399 a6b600d Author: Collider LI <lhc199652@gmail.com> Date: Thu Apr 28 02:12:43 2022 -0400 Merge branch 'issue-1720' of https://github.com/low-batt/iina into low-batt-issue-1720 commit a6b600d Author: low-batt <86170219+low-batt@users.noreply.github.com> Date: Sun Jul 25 23:14:05 2021 -0400 Fix memory leaks in FFmpegController, #1720 The method `getPeeksForFile` in `FFmpegController` is leaking memory when generating thumbnails. This commit will: - Add a `@try-@finally` block in the while loop to free the packet - Replace `av_free` by `av_frame_free`, when freeing an `AVFrame` - Add a call to `sws_freeContext` to free the `SwsContext` - Replace deprecated method `avcodec_close` with `avcodec_free_context` - Add `nullable` annotation to declaration of `probeVideoInfoForFile` This is a stopgap fix and does not address all of the potential leaks in the method. This commit focuses on the leaks that occur during the normal flow when generating thumbnails. Error flows will still leak memory. At some point this method should be refactored to always properly free memory.
- Loading branch information