From 35d550d229b219f5a02cb9194c3bd24329f975ed Mon Sep 17 00:00:00 2001 From: jvoisin Date: Thu, 16 May 2019 00:31:40 +0200 Subject: Use memoization get _*_path() functions This shouldn't make a big difference in the CLI/extension usage, but might improve the performances of long-running instances, or people misusing the API. --- libmat2/video.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libmat2/video.py') diff --git a/libmat2/video.py b/libmat2/video.py index 0060f78..1492ba1 100644 --- a/libmat2/video.py +++ b/libmat2/video.py @@ -1,3 +1,4 @@ +import functools import os import logging @@ -130,6 +131,7 @@ class MP4Parser(AbstractFFmpegParser): } +@functools.lru_cache() def _get_ffmpeg_path() -> str: # pragma: no cover ffmpeg_path = '/usr/bin/ffmpeg' if os.path.isfile(ffmpeg_path): -- cgit v1.3