mirror of https://bitbucket.org/ausocean/av.git
Merged in no-empty-header (pull request #95)
stream/flv: remove unnecessary header write on creation Approved-by: Alan Noble <anoble@gmail.com> Approved-by: Saxon Milton <saxon.milton@gmail.com>
This commit is contained in:
commit
c0d0eebf1a
|
@ -292,10 +292,7 @@ func (r *Revid) reset(config Config) error {
|
||||||
r.encoder = mts.NewEncoder(&r.packer, float64(r.config.FrameRate))
|
r.encoder = mts.NewEncoder(&r.packer, float64(r.config.FrameRate))
|
||||||
case Flv:
|
case Flv:
|
||||||
r.config.Logger.Log(logger.Info, pkg+"using FLV packetisation")
|
r.config.Logger.Log(logger.Info, pkg+"using FLV packetisation")
|
||||||
r.encoder, err = flv.NewEncoder(&r.packer, true, true, int(r.config.FrameRate))
|
r.encoder = flv.NewEncoder(&r.packer, true, true, int(r.config.FrameRate))
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -66,19 +66,13 @@ type Encoder struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewEncoder retuns a new FLV encoder.
|
// NewEncoder retuns a new FLV encoder.
|
||||||
func NewEncoder(dst io.Writer, audio, video bool, fps int) (*Encoder, error) {
|
func NewEncoder(dst io.Writer, audio, video bool, fps int) *Encoder {
|
||||||
e := Encoder{
|
return &Encoder{
|
||||||
dst: dst,
|
dst: dst,
|
||||||
fps: fps,
|
fps: fps,
|
||||||
audio: audio,
|
audio: audio,
|
||||||
video: video,
|
video: video,
|
||||||
}
|
}
|
||||||
// TODO(kortschak): Do this lazily.
|
|
||||||
_, err := e.dst.Write(e.HeaderBytes())
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return &e, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// HeaderBytes returns the a
|
// HeaderBytes returns the a
|
||||||
|
|
Loading…
Reference in New Issue