diff options
author | morpheus65535 <[email protected]> | 2024-03-03 12:15:23 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2024-03-03 12:15:23 -0500 |
commit | 03afeb347075381bcb7fd6036295c9fa4a90d2dc (patch) | |
tree | 7c5d72c973d2c8e4ade57391a1c9ad5e94903a46 /libs/pymediainfo | |
parent | 9ae684240b5bdd40a870d8122f0e380f8d03a187 (diff) | |
download | bazarr-03afeb347075381bcb7fd6036295c9fa4a90d2dc.tar.gz bazarr-03afeb347075381bcb7fd6036295c9fa4a90d2dc.zip |
Updated multiple Python modules (now in libs and custom_libs directories) and React libraries
Diffstat (limited to 'libs/pymediainfo')
-rw-r--r-- | libs/pymediainfo/__init__.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/pymediainfo/__init__.py b/libs/pymediainfo/__init__.py index 840ec18c3..5cce5fad0 100644 --- a/libs/pymediainfo/__init__.py +++ b/libs/pymediainfo/__init__.py @@ -363,6 +363,7 @@ class MediaInfo: legacy_stream_display: bool = False, mediainfo_options: Optional[Dict[str, str]] = None, output: Optional[str] = None, + buffer_size: Optional[int] = 64 * 1024, ) -> Union[str, "MediaInfo"]: """ Analyze a media file using libmediainfo. @@ -406,6 +407,8 @@ class MediaInfo: * ``"JSON"`` * ``%``-delimited templates (see ``mediainfo --Info-Parameters``) + :param int buffer_size: size of the buffer used to read the file, in bytes. This is only + used when `filename` is a file-like object. :type filename: str or pathlib.Path or os.PathLike or file-like object. :rtype: str if `output` is set. :rtype: :class:`MediaInfo` otherwise. @@ -467,7 +470,7 @@ class MediaInfo: raise ValueError("File should be opened in binary mode") lib.MediaInfo_Open_Buffer_Init(handle, file_size, 0) while True: - buffer = filename.read(64 * 1024) + buffer = filename.read(buffer_size) if buffer: # https://github.com/MediaArea/MediaInfoLib/blob/v20.09/Source/MediaInfo/File__Analyze.h#L1429 # 4th bit = finished |