transcoder icon indicating copy to clipboard operation
transcoder copied to clipboard

ffmpeg InputPipe & OutputPipe issue

Open bennyscetbun opened this issue 4 years ago • 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 ?

bennyscetbun avatar Nov 25 '20 17:11 bennyscetbun