diff --git a/iamf/cli/cli_util.cc b/iamf/cli/cli_util.cc index 6e21c47b..7a949c75 100644 --- a/iamf/cli/cli_util.cc +++ b/iamf/cli/cli_util.cc @@ -323,7 +323,8 @@ absl::Status GetCommonSampleRateAndBitDepth( bool& requires_resampling) { requires_resampling = false; if (sample_rates.empty() || bit_depths.empty()) { - return absl::InvalidArgumentError(""); + return absl::InvalidArgumentError( + "Expected at least one sample rate and bit depth."); } if (sample_rates.size() == 1) { diff --git a/iamf/cli/proto_to_obu/audio_element_generator.cc b/iamf/cli/proto_to_obu/audio_element_generator.cc index e1bbe236..84b0e299 100644 --- a/iamf/cli/proto_to_obu/audio_element_generator.cc +++ b/iamf/cli/proto_to_obu/audio_element_generator.cc @@ -368,9 +368,9 @@ absl::Status CollectDcgLabels( coupled_substream_labels->push_back("Ltf4"); coupled_substream_labels->push_back("Rtf4"); } else { - LOG(ERROR) << "Unsupported number of height channels: " - << accumulated_channels.height; - return InvalidArgumentError(""); + return InvalidArgumentError( + absl::StrCat("Unsupported number of height channels: ", + accumulated_channels.height)); } } diff --git a/iamf/cli/proto_to_obu/mix_presentation_generator.cc b/iamf/cli/proto_to_obu/mix_presentation_generator.cc index ef465327..d60e4277 100644 --- a/iamf/cli/proto_to_obu/mix_presentation_generator.cc +++ b/iamf/cli/proto_to_obu/mix_presentation_generator.cc @@ -355,9 +355,9 @@ absl::Status MixPresentationGenerator::CopyUserAnchoredLoudness( obu_anchor_element = kAnchorElementAlbum; break; default: - LOG(ERROR) << "Unknown anchor_element: " - << metadata_anchor_element.anchor_element(); - return absl::InvalidArgumentError(""); + return absl::InvalidArgumentError( + absl::StrCat("Unknown anchor_element= ", + metadata_anchor_element.anchor_element())); } int16_t obu_anchored_loudness; diff --git a/iamf/obu/param_definitions.cc b/iamf/obu/param_definitions.cc index 1e255533..c0903bc4 100644 --- a/iamf/obu/param_definitions.cc +++ b/iamf/obu/param_definitions.cc @@ -217,9 +217,8 @@ absl::Status ParamDefinition::Validate() const { absl::Status status = absl::OkStatus(); if (parameter_rate_ == 0) { - LOG(ERROR) << "Parameter rate should not be zero. Parameter ID= " - << parameter_id; - status = absl::InvalidArgumentError(""); + status = absl::InvalidArgumentError(absl::StrCat( + "Parameter rate should not be zero. Parameter ID= ", parameter_id)); } // Fields below are conditional on `param_definition_mode == 1`. Otherwise