@@ -23,7 +23,7 @@ type Transcoder struct {
23
23
config * Config
24
24
input string
25
25
output []string
26
- options [][] string
26
+ options []transcoder. Options
27
27
metadata transcoder.Metadata
28
28
inputPipeReader io.ReadCloser
29
29
outputPipeReader io.ReadCloser
@@ -68,16 +68,20 @@ func (t *Transcoder) Start(opts transcoder.Options) (<-chan transcoder.Progress,
68
68
// Just append the 1 output file we've got
69
69
args = append (args , t .output [0 ])
70
70
} else {
71
+ arguments := make ([][]string , len (t .options ))
72
+ for i , o := range t .options {
73
+ arguments [i ] = o .GetStrArguments ()
74
+ }
71
75
for index , out := range t .output {
72
76
// Get executable flags
73
77
// If we are at the last output file but still have several options, append them all at once
74
78
if index == outputLength - 1 && outputLength < optionsLength {
75
79
for i := index ; i < len (t .options ); i ++ {
76
- args = append (args , t . options [i ]... )
80
+ args = append (args , arguments [i ]... )
77
81
}
78
82
// Otherwise just append the current options
79
83
} else {
80
- args = append (args , t . options [index ]... )
84
+ args = append (args , arguments [index ]... )
81
85
}
82
86
83
87
// Append output flag
@@ -163,13 +167,13 @@ func (t *Transcoder) OutputPipe(w io.WriteCloser, r io.ReadCloser) transcoder.Tr
163
167
164
168
// WithOptions Sets the options object
165
169
func (t * Transcoder ) WithOptions (opts transcoder.Options ) transcoder.Transcoder {
166
- t .options = [][] string {opts . GetStrArguments () }
170
+ t .options = []transcoder. Options {opts }
167
171
return t
168
172
}
169
173
170
174
// WithAdditionalOptions Appends an additional options object
171
175
func (t * Transcoder ) WithAdditionalOptions (opts transcoder.Options ) transcoder.Transcoder {
172
- t .options = append (t .options , opts . GetStrArguments () )
176
+ t .options = append (t .options , opts )
173
177
return t
174
178
}
175
179
0 commit comments