use ceil() on duration float() instead of int() directly

This commit is contained in:
Lex Berezhny 2020-03-31 10:57:37 -04:00
parent 5ec74f8abe
commit 6f22f6a59f

View file

@ -8,6 +8,7 @@ import re
import shlex import shlex
import shutil import shutil
import subprocess import subprocess
from math import ceil
import lbry.utils import lbry.utils
from lbry.conf import TranscodeConfig from lbry.conf import TranscodeConfig
@ -354,7 +355,7 @@ class VideoFileAnalyzer:
def _build_spec(scan_data): def _build_spec(scan_data):
assert scan_data assert scan_data
duration = int(scan_data["format"]["duration"]) # existence verified when scan_data made duration = ceil(float(scan_data["format"]["duration"])) # existence verified when scan_data made
width = -1 width = -1
height = -1 height = -1
for stream in scan_data["streams"]: for stream in scan_data["streams"]: