Fix opus codec panic on read after close (#440)

Also add test to other codecs
This commit is contained in:
Atsushi Watanabe
2022-08-24 20:23:57 +09:00
committed by GitHub
parent 8ad810e61e
commit 58dc90d03a
8 changed files with 165 additions and 0 deletions

View File

@@ -65,6 +65,25 @@ func TestEncoder(t *testing.T) {
},
})
})
t.Run("ReadAfterClose", func(t *testing.T) {
p, err := factory()
if err != nil {
t.Fatal(err)
}
codectest.VideoEncoderReadAfterCloseTest(t, p,
prop.Media{
Video: prop.Video{
Width: 256,
Height: 144,
FrameFormat: frame.FormatI420,
},
},
image.NewYCbCr(
image.Rect(0, 0, 256, 144),
image.YCbCrSubsampleRatio420,
),
)
})
})
}
}