Check if dup frame didn't exist

FBNeo can return dup frame flag before its first frame.
This commit is contained in:
Sergey Stepanov 2024-03-21 23:02:02 +03:00
parent 4d5033f03c
commit 84f55691eb
No known key found for this signature in database
GPG key ID: A56B4929BAA8556B

View file

@ -209,7 +209,9 @@ func (f *Frontend) handleVideo(data []byte, delta int32, fi nanoarch.FrameInfo)
}
func (f *Frontend) handleDup() {
f.onVideo(*lastFrame)
if lastFrame != nil {
f.onVideo(*lastFrame)
}
}
func (f *Frontend) Shutdown() {
@ -217,6 +219,7 @@ func (f *Frontend) Shutdown() {
f.nano.Shutdown()
f.SetAudioCb(noAudio)
f.SetVideoCb(noVideo)
lastFrame = nil
f.mu.Unlock()
f.log.Debug().Msgf("frontend shutdown done")
}