@@ -14,8 +14,8 @@ import (
14
14
"strconv"
15
15
"strings"
16
16
17
- "github.com/floostack /transcoder"
18
- "github.com/floostack /transcoder/utils"
17
+ "github.com/wolfhong /transcoder"
18
+ "github.com/wolfhong /transcoder/utils"
19
19
)
20
20
21
21
// Transcoder ...
@@ -38,7 +38,7 @@ func New(cfg *Config) transcoder.Transcoder {
38
38
}
39
39
40
40
// Start ...
41
- func (t * Transcoder ) Start (opts transcoder.Options ) (<- chan transcoder.Progress , error ) {
41
+ func (t * Transcoder ) Start (opts transcoder.Options ) (<- chan transcoder.Progress , * os. Process , error ) {
42
42
43
43
var stderrIn io.ReadCloser
44
44
@@ -48,13 +48,13 @@ func (t *Transcoder) Start(opts transcoder.Options) (<-chan transcoder.Progress,
48
48
49
49
// Validates config
50
50
if err := t .validate (); err != nil {
51
- return nil , err
51
+ return nil , nil , err
52
52
}
53
53
54
54
// Get file metadata
55
55
_ , err := t .GetMetadata ()
56
56
if err != nil {
57
- return nil , err
57
+ return nil , nil , err
58
58
}
59
59
60
60
// Append input file and standard options
@@ -98,7 +98,7 @@ func (t *Transcoder) Start(opts transcoder.Options) (<-chan transcoder.Progress,
98
98
if t .config .ProgressEnabled && ! t .config .Verbose {
99
99
stderrIn , err = cmd .StderrPipe ()
100
100
if err != nil {
101
- return nil , fmt .Errorf ("Failed getting transcoding progress (%s) with args (%s) with error %s" , t .config .FfmpegBinPath , args , err )
101
+ return nil , nil , fmt .Errorf ("Failed getting transcoding progress (%s) with args (%s) with error %s" , t .config .FfmpegBinPath , args , err )
102
102
}
103
103
}
104
104
@@ -109,7 +109,7 @@ func (t *Transcoder) Start(opts transcoder.Options) (<-chan transcoder.Progress,
109
109
// Start process
110
110
err = cmd .Start ()
111
111
if err != nil {
112
- return nil , fmt .Errorf ("Failed starting transcoding (%s) with args (%s) with error %s" , t .config .FfmpegBinPath , args , err )
112
+ return nil , nil , fmt .Errorf ("Failed starting transcoding (%s) with args (%s) with error %s" , t .config .FfmpegBinPath , args , err )
113
113
}
114
114
115
115
if t .config .ProgressEnabled && ! t .config .Verbose {
@@ -125,7 +125,7 @@ func (t *Transcoder) Start(opts transcoder.Options) (<-chan transcoder.Progress,
125
125
err = cmd .Wait ()
126
126
}
127
127
128
- return out , nil
128
+ return out , cmd . Process , nil
129
129
}
130
130
131
131
// Input ...
0 commit comments