floostack/transcoder

ffmpeg InputPipe & OutputPipe issue

bennyscetbun opened this issue · 1 comments

Hi there,
I was trying to use your code and i found this in your code:

// InputPipe ...
func (t *Transcoder) InputPipe(w *io.WriteCloser, r *io.ReadCloser) transcoder.Transcoder {
	if &t.input == nil {
		t.inputPipeWriter = w
		t.inputPipeReader = r
	}
	return t
}

// OutputPipe ...
func (t *Transcoder) OutputPipe(w *io.WriteCloser, r *io.ReadCloser) transcoder.Transcoder {
	if &t.output == nil {
		t.outputPipeWriter = w
		t.outputPipeReader = r
	}
	return t
}

i don't understand why you've wrote &t.input == nil and &t.output == nil.
if t was nil, t.input should fail and if t.input is empty its address will never be nil (same for t.output)
It should be t.input == "" and t.output == nil ?
or i missed something ?