File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -546,7 +546,10 @@ def _get_av_container(self):
546546 self ._source_path [0 ].seek (0 ) # required for re-reading
547547
548548 encoding = self .get_file_encoding (self ._source_path [0 ])
549- return av .open (self ._source_path [0 ], metadata_encoding = encoding )
549+ if encoding :
550+ return av .open (self ._source_path [0 ], metadata_encoding = encoding )
551+ else :
552+ return av .open (self ._source_path [0 ])
550553
551554 def _get_duration (self ):
552555 with self ._get_av_container () as container :
Original file line number Diff line number Diff line change @@ -970,7 +970,10 @@ def get_audio_duration(file_path):
970970 slogger .glob .debug ("ENCODING" )
971971 slogger .glob .debug (encoding )
972972 # Open the audio file
973- container = av .open (file_path , metadata_encoding = encoding )
973+ if encoding :
974+ container = av .open (file_path , metadata_encoding = encoding )
975+ else :
976+ container = av .open (file_path )
974977
975978 # Get the first audio stream
976979 audio_stream = next ((stream for stream in container .streams if stream .codec .type == 'audio' ), None )
You can’t perform that action at this time.
0 commit comments