Skip to content

Commit 96f877c

Browse files
committed
check if image and audio fields aren't empty
1 parent 2558235 commit 96f877c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

encoder/encoder.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,13 +694,13 @@ end
694694
local create_job = function(job_type, sub, audio_padding)
695695
local current_timestamp, on_finish_fn
696696
local job = {}
697-
if job_type == 'snapshot' and h.has_video_track() then
697+
if job_type == 'snapshot' and h.has_video_track() and not h.is_empty(self.config.image_field) then
698698
current_timestamp = mp.get_property_number("time-pos", 0)
699699
job.filename = make_snapshot_filename(sub['start'], sub['end'], current_timestamp)
700700
job.run_async = function()
701701
create_snapshot(sub['start'], sub['end'], current_timestamp, job.filename, on_finish_fn)
702702
end
703-
elseif job_type == 'audioclip' and h.has_audio_track() then
703+
elseif job_type == 'audioclip' and h.has_audio_track() and not h.is_empty(self.config.audio_field) then
704704
job.filename = make_audio_filename(sub['start'], sub['end'])
705705
job.run_async = function()
706706
create_audio(sub['start'], sub['end'], job.filename, audio_padding, on_finish_fn)

0 commit comments

Comments
 (0)