Skip to content

Commit

Permalink
get_packet_sizes: filepath -> src_file
Browse files Browse the repository at this point in the history
  • Loading branch information
LightArrowsEXE committed May 22, 2024
1 parent 421a2c3 commit 31b925b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lvsfunc/packets/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
@overload
def get_packet_sizes(
clip: vs.VideoNode,
filepath: SPathLike | None = None,
src_file: SPathLike | None = None,
out_file: SPathLike | None = None,
keyframes: Keyframes | None = None,
offset: int = 0,
Expand All @@ -35,7 +35,7 @@ def get_packet_sizes(
@overload
def get_packet_sizes( # type:ignore[misc]
clip: vs.VideoNode,
filepath: SPathLike | None = None,
src_file: SPathLike | None = None,
out_file: SPathLike | None = None,
keyframes: Keyframes | None = None,
offset: int = 0,
Expand All @@ -47,7 +47,7 @@ def get_packet_sizes( # type:ignore[misc]

def get_packet_sizes(
clip: vs.VideoNode,
filepath: SPathLike | None = None,
src_file: SPathLike | None = None,
out_file: SPathLike | None = None,
keyframes: Keyframes | None = None,
offset: int = 0,
Expand Down Expand Up @@ -76,7 +76,7 @@ def get_packet_sizes(
* `ffprobe <https://ffmpeg.org/download.html>`_
:param clip: Clip to add the properties to.
:param filepath: The path to the original file that was indexed.
:param src_file: The path to the original file that was indexed.
If None, tries to read the `idx_filepath` property from `clip`.
Will throw an error if it can't find either.
This parameter is ignored if `out_file` is set and a file can be read.
Expand Down Expand Up @@ -107,8 +107,8 @@ def get_packet_sizes(
with open(out_file, "r+") as f:
pkt_sizes = [int(pkt) for pkt in f.readlines()]
else:
sfile = get_file_from_path_or_clip(clip, filepath, func)
pkt_sizes = _get_frames(sfile, func)
sfile = get_file_from_path_or_clip(clip, src_file, func)

if out_file is not None and not (sout := SPath(out_file)).exists():
print(f"Writing packet sizes to \"{sout.absolute()}\"...")
Expand Down

0 comments on commit 31b925b

Please sign in to comment.