Skip to content

Commit

Permalink
android_jni: Include libyuv in version string only when available
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshvg committed Sep 20, 2023
1 parent f2e16fd commit 63a8165
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions android_jni/avifandroidjni/src/main/jni/libavif_jni.cc
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,17 @@ FUNC(jstring, resultToString, jint result) {
FUNC(jstring, versionString) {
char codec_versions[256];
avifCodecVersions(codec_versions);
char libyuv_version[64];
if (avifLibYUVVersion() > 0) {
snprintf(libyuv_version, sizeof(libyuv_version), " libyuv: %d.",
avifLibYUVVersion());
} else {
*libyuv_version = 0;
}
char version_string[512];
snprintf(version_string, sizeof(version_string),
"libavif: %s. Codecs: %s. libyuv: %d.", avifVersion(),
codec_versions, avifLibYUVVersion());
"libavif: %s. Codecs: %s.%s", avifVersion(),
codec_versions, libyuv_version);
return env->NewStringUTF(version_string);
}

Expand Down

0 comments on commit 63a8165

Please sign in to comment.