mirror of https://bitbucket.org/ausocean/av.git
stream/flv: fixed what encoder.Write is doing with it's integer return value
This commit is contained in:
parent
00f2b66a8b
commit
61d70dc9a6
|
@ -184,9 +184,9 @@ func (e *Encoder) Write(frame []byte) (int, error) {
|
||||||
// See https://download.macromedia.com/f4v/video_file_format_spec_v10_1.pdf
|
// See https://download.macromedia.com/f4v/video_file_format_spec_v10_1.pdf
|
||||||
// section E.3.
|
// section E.3.
|
||||||
var zero [4]byte
|
var zero [4]byte
|
||||||
n, err := e.dst.Write(zero[:])
|
_, err := e.dst.Write(zero[:])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return n, err
|
return 0, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
timeStamp := e.getNextTimestamp()
|
timeStamp := e.getNextTimestamp()
|
||||||
|
@ -215,9 +215,9 @@ func (e *Encoder) Write(frame []byte) (int, error) {
|
||||||
Data: frame,
|
Data: frame,
|
||||||
PrevTagSize: uint32(videoHeaderSize + len(frame)),
|
PrevTagSize: uint32(videoHeaderSize + len(frame)),
|
||||||
}
|
}
|
||||||
n, err := e.dst.Write(tag.Bytes())
|
_, err := e.dst.Write(tag.Bytes())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return n, err
|
return len(frame), err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Do we even have some audio to send off ?
|
// Do we even have some audio to send off ?
|
||||||
|
@ -236,9 +236,9 @@ func (e *Encoder) Write(frame []byte) (int, error) {
|
||||||
Data: dummyAudioTag1Data,
|
Data: dummyAudioTag1Data,
|
||||||
PrevTagSize: uint32(audioSize),
|
PrevTagSize: uint32(audioSize),
|
||||||
}
|
}
|
||||||
n, err := e.dst.Write(tag.Bytes())
|
_, err := e.dst.Write(tag.Bytes())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return n, err
|
return len(frame), err
|
||||||
}
|
}
|
||||||
|
|
||||||
tag = AudioTag{
|
tag = AudioTag{
|
||||||
|
@ -253,9 +253,9 @@ func (e *Encoder) Write(frame []byte) (int, error) {
|
||||||
Data: dummyAudioTag2Data,
|
Data: dummyAudioTag2Data,
|
||||||
PrevTagSize: uint32(22),
|
PrevTagSize: uint32(22),
|
||||||
}
|
}
|
||||||
n, err = e.dst.Write(tag.Bytes())
|
_, err = e.dst.Write(tag.Bytes())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return n, err
|
return len(frame), err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue