Skip to content

Commit 3a61e8a

Browse files
authored
Merge pull request #1464 from pszemus/aom_codec_set_option_warn
aom: print warning on `aom_codec_set_option` failure
2 parents 3cdb3cc + 73c8e71 commit 3a61e8a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

libheif/plugins/encoder_aom.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <algorithm>
2525
#include <cstring>
2626
#include <cassert>
27+
#include <iostream>
2728
#include <vector>
2829
#include <string>
2930
#include <thread>
@@ -1058,7 +1059,10 @@ struct heif_error aom_encode_image(void* encoder_raw, const struct heif_image* i
10581059
// Apply the custom AOM encoder options.
10591060
// These should always be applied last as they can override the values that were set above.
10601061
for (const auto& p : encoder->custom_options) {
1061-
aom_codec_set_option(&codec, p.name.c_str(), p.value.c_str());
1062+
if (aom_codec_set_option(&codec, p.name.c_str(), p.value.c_str()) != AOM_CODEC_OK) {
1063+
std::cerr << "[libheif] warning: AOM encoder option (name: " << p.name << ", value: " << p.value << ") setting failed: "
1064+
<< aom_codec_error(&codec) << " - " << aom_codec_error_detail(&codec) << "\n";
1065+
}
10621066
}
10631067
#endif
10641068

0 commit comments

Comments
 (0)