Fix MP4 consumer with only audio
This commit is contained in:
@@ -52,6 +52,18 @@ func (c *Codec) IsRTP() bool {
|
||||
return c.PayloadType != PayloadTypeRAW
|
||||
}
|
||||
|
||||
func (c *Codec) IsVideo() bool {
|
||||
return c.Kind() == KindVideo
|
||||
}
|
||||
|
||||
func (c *Codec) IsAudio() bool {
|
||||
return c.Kind() == KindAudio
|
||||
}
|
||||
|
||||
func (c *Codec) Kind() string {
|
||||
return GetKind(c.Name)
|
||||
}
|
||||
|
||||
func (c *Codec) Clone() *Codec {
|
||||
clone := *c
|
||||
return &clone
|
||||
|
||||
@@ -153,6 +153,10 @@ func (c *Consumer) AddTrack(media *core.Media, _ *core.Codec, track *core.Receiv
|
||||
}
|
||||
|
||||
func (c *Consumer) WriteTo(wr io.Writer) (int64, error) {
|
||||
if len(c.Senders) == 1 && c.Senders[0].Codec.IsAudio() {
|
||||
c.start = true
|
||||
}
|
||||
|
||||
init, err := c.muxer.GetInit()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
|
||||
Reference in New Issue
Block a user