Skip to content
This repository was archived by the owner on Sep 29, 2023. It is now read-only.

Commit 1f7b650

Browse files
committed
Fixed dependencies
1 parent 9fd349b commit 1f7b650

File tree

7 files changed

+22
-27
lines changed

7 files changed

+22
-27
lines changed

config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package gotrans
1+
package transcoder
22

33
// Config ...
44
type Config interface{}

ffmpeg/ffmpeg.go

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313
"strconv"
1414
"strings"
1515

16-
"github.com/floostack/gotrans"
17-
"github.com/floostack/gotrans/utils"
16+
"github.com/floostack/transcoder"
17+
"github.com/floostack/transcoder/utils"
1818
)
1919

2020
// Transcoder ...
@@ -31,16 +31,16 @@ type Transcoder struct {
3131
}
3232

3333
// New ...
34-
func New(cfg *Config) gotrans.Transcoder {
34+
func New(cfg *Config) transcoder.Transcoder {
3535
return &Transcoder{config: cfg}
3636
}
3737

3838
// Start ...
39-
func (t *Transcoder) Start(opts gotrans.Options) (<-chan gotrans.Progress, error) {
39+
func (t *Transcoder) Start(opts transcoder.Options) (<-chan transcoder.Progress, error) {
4040

4141
var stderrIn io.ReadCloser
4242

43-
out := make(chan gotrans.Progress)
43+
out := make(chan transcoder.Progress)
4444

4545
defer t.closePipes()
4646

@@ -64,8 +64,6 @@ func (t *Transcoder) Start(opts gotrans.Options) (<-chan gotrans.Progress, error
6464
// Initialize command
6565
cmd := exec.Command(t.config.FfmpegBinPath, args...)
6666

67-
// cmd.Stderr = os.Stdout
68-
6967
// If progresss enabled, get stderr pipe and start progress process
7068
if t.config.ProgressEnabled && !t.config.Verbose {
7169
stderrIn, err = cmd.StderrPipe()
@@ -88,31 +86,32 @@ func (t *Transcoder) Start(opts gotrans.Options) (<-chan gotrans.Progress, error
8886
go func() {
8987
t.progress(stderrIn, out)
9088
}()
91-
}
9289

93-
go func() {
94-
defer close(out)
95-
// Start process
90+
go func() {
91+
defer close(out)
92+
err = cmd.Wait()
93+
}()
94+
} else {
9695
err = cmd.Wait()
97-
}()
96+
}
9897

9998
return out, nil
10099
}
101100

102101
// Input ...
103-
func (t *Transcoder) Input(arg string) gotrans.Transcoder {
102+
func (t *Transcoder) Input(arg string) transcoder.Transcoder {
104103
t.input = arg
105104
return t
106105
}
107106

108107
// Output ...
109-
func (t *Transcoder) Output(arg string) gotrans.Transcoder {
108+
func (t *Transcoder) Output(arg string) transcoder.Transcoder {
110109
t.output = arg
111110
return t
112111
}
113112

114113
// InputPipe ...
115-
func (t *Transcoder) InputPipe(w *io.WriteCloser, r *io.ReadCloser) gotrans.Transcoder {
114+
func (t *Transcoder) InputPipe(w *io.WriteCloser, r *io.ReadCloser) transcoder.Transcoder {
116115
if &t.input == nil {
117116
t.inputPipeWriter = w
118117
t.inputPipeReader = r
@@ -121,7 +120,7 @@ func (t *Transcoder) InputPipe(w *io.WriteCloser, r *io.ReadCloser) gotrans.Tran
121120
}
122121

123122
// OutputPipe ...
124-
func (t *Transcoder) OutputPipe(w *io.WriteCloser, r *io.ReadCloser) gotrans.Transcoder {
123+
func (t *Transcoder) OutputPipe(w *io.WriteCloser, r *io.ReadCloser) transcoder.Transcoder {
125124
if &t.output == nil {
126125
t.outputPipeWriter = w
127126
t.outputPipeReader = r
@@ -130,7 +129,7 @@ func (t *Transcoder) OutputPipe(w *io.WriteCloser, r *io.ReadCloser) gotrans.Tra
130129
}
131130

132131
// WithOptions ...
133-
func (t *Transcoder) WithOptions(opts gotrans.Options) gotrans.Transcoder {
132+
func (t *Transcoder) WithOptions(opts transcoder.Options) transcoder.Transcoder {
134133
t.options = opts.GetStrArguments()
135134
return t
136135
}
@@ -187,7 +186,7 @@ func (t *Transcoder) getMetadata() (metadata *Metadata, err error) {
187186
}
188187

189188
// progress sends through given channel the transcoding status
190-
func (t *Transcoder) progress(stream io.ReadCloser, out chan gotrans.Progress) {
189+
func (t *Transcoder) progress(stream io.ReadCloser, out chan transcoder.Progress) {
191190

192191
defer stream.Close()
193192

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module github.com/floostack/gotrans
1+
module github.com/floostack/transcoder
22

33
go 1.13

options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package gotrans
1+
package transcoder
22

33
// Options ...
44
type Options interface {

progress.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package gotrans
1+
package transcoder
22

33
// Progress ...
44
type Progress interface {

source.go

Lines changed: 0 additions & 4 deletions
This file was deleted.

transcoder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package gotrans
1+
package transcoder
22

33
import "io"
44

0 commit comments

Comments
 (0)