Improve error handling.
This commit is contained in:
@@ -14,6 +14,7 @@ from tqdm import tqdm
|
||||
from typeguard import typechecked
|
||||
|
||||
from tscut.exceptions import ExternalToolError, InvalidMediaError, TemporaryFileError
|
||||
from tscut.temporaries import TemporaryFiles
|
||||
from tscut.tools.ffprobe import (
|
||||
get_frames_in_stream,
|
||||
get_video_dimensions,
|
||||
@@ -21,7 +22,6 @@ from tscut.tools.ffprobe import (
|
||||
)
|
||||
from tscut.tools.ppm import dump_ppm
|
||||
from tscut.tools.timeframe import get_packet_duration, parse_timestamp
|
||||
from tscut.temporaries import TemporaryFiles
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -263,8 +263,6 @@ def extract_all_streams(ffmpeg_path:str, ffprobe_path:str, input_file:IO[bytes],
|
||||
logger.debug("Found %d packets to be extracted from audio track.", nb_packets)
|
||||
if nb_packets > 0:
|
||||
packet_duration = get_packet_duration(packets[0])
|
||||
if packet_duration is None:
|
||||
return None
|
||||
else:
|
||||
packet_duration = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user