Skip to content

Commit

Permalink
fix: Ensure there is an audio track
Browse files Browse the repository at this point in the history
  • Loading branch information
DblK committed Aug 1, 2022
1 parent 1e09bef commit a4d86c8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions go/ffmpeg.go
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,11 @@ func (s *FFMPEG) ToString() []string {
aTracks = aTracks + "[atrack" + cast.ToString(i) + "] "
}
}
filterComplex = filterComplex + aTracks +
" amix=inputs=" + cast.ToString(len(strings.Split(aTracks, " "))-1) + " [atracks];"
// Ensure there is an audio track
if aTracks != "" {
filterComplex = filterComplex + aTracks +
" amix=inputs=" + cast.ToString(len(strings.Split(aTracks, " "))-1) + " [atracks];"
}

// Remove pending ";" if exists
if filterComplex[len(filterComplex)-1:] == ";" {
Expand Down

0 comments on commit a4d86c8

Please sign in to comment.