test(imagorvideo): fallback image tests

This commit is contained in:
Adrian Shum 2022-09-16 21:56:09 +08:00 committed by GitHub
parent d9c697a0b2
commit 035cf78b96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 47 additions and 14 deletions

View file

@ -278,7 +278,7 @@ func convertFrameToRGB(av *AVContext) error {
func exportBuffer(av *AVContext) ([]byte, error) {
if !av.hasFrame {
return nil, ErrDecoderNotFound
return nil, ErrInvalidData
}
size := av.height * av.width
if av.hasAlpha {

View file

@ -31,6 +31,7 @@ func TestAVContext(t *testing.T) {
SetFFmpegLogLevel(AVLogDebug)
logger := zap.NewExample()
SetLogging(nil)
log(AVLogDebug, "nop logging")
SetLogging(func(level AVLogLevel, message string) {
message = strings.TrimSuffix(message, "\n")
switch level {