Skip to content

Commit 38b13bd

Browse files
committed
lavc SVT: check for libsvtav1 explicitly
If checking AV1 properties, check if the codecs is really libsvtav1. It can be also libsvt_vp9, where the option setting would fail (athough innocent, it may be confusing).
1 parent 9b80a61 commit 38b13bd

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/video_compress/libavcodec.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,7 +1890,7 @@ static void configure_svt(AVCodecContext *codec_ctx, struct setparam_param *para
18901890
check_av_opt_set<int>(codec_ctx->priv_data, "tile_col_cnt", tile_col_cnt);
18911891
check_av_opt_set<int>(codec_ctx->priv_data, "tile_slice_mode", 1);
18921892
}
1893-
} else { // libsvtav1
1893+
} else if ("libsvtav1"s == codec_ctx->codec->name) {
18941894
#if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(59, 21, 100)
18951895
//pred-struct=1 is low-latency mode
18961896
if (int ret = av_opt_set(codec_ctx->priv_data, "svtav1-params", "pred-struct=1:tile-columns=2:tile-rows=2", 0)) {
@@ -1899,9 +1899,7 @@ static void configure_svt(AVCodecContext *codec_ctx, struct setparam_param *para
18991899
#else
19001900
// tile_columns and tile_rows are log2 values
19011901
for (auto const &val : { "tile_columns", "tile_rows" }) {
1902-
if (int ret = av_opt_set_int(codec_ctx->priv_data, val, 2, 0)) {
1903-
print_libav_error(LOG_LEVEL_WARNING, MOD_NAME "Unable to set tile dimensions for SVT AV1", ret);
1904-
}
1902+
check_av_opt_set<int>(codec_ctx->priv_data, val, 2, "tile dimensions for SVT AV1");
19051903
}
19061904
#endif
19071905
}

0 commit comments

Comments
 (0)