Skip to content

Commit fb3448b

Browse files
authored
bit_rate -> bitRate for C++ code (#633)
1 parent 619f1ce commit fb3448b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/torchcodec/_core/Encoder.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ AudioEncoder::AudioEncoder(
4141
const torch::Tensor wf,
4242
int sampleRate,
4343
std::string_view fileName,
44-
std::optional<int64_t> bit_rate)
44+
std::optional<int64_t> bitRate)
4545
: wf_(wf) {
4646
TORCH_CHECK(
4747
wf_.dtype() == torch::kFloat32,
@@ -82,12 +82,12 @@ AudioEncoder::AudioEncoder(
8282
TORCH_CHECK(avCodecContext != nullptr, "Couldn't allocate codec context.");
8383
avCodecContext_.reset(avCodecContext);
8484

85-
if (bit_rate.has_value()) {
86-
TORCH_CHECK(*bit_rate >= 0, "bit_rate=", *bit_rate, " must be >= 0.");
85+
if (bitRate.has_value()) {
86+
TORCH_CHECK(*bitRate >= 0, "bit_rate=", *bitRate, " must be >= 0.");
8787
}
8888
// bit_rate=None defaults to 0, which is what the FFmpeg CLI seems to use as
8989
// well when "-b:a" isn't specified.
90-
avCodecContext_->bit_rate = bit_rate.value_or(0);
90+
avCodecContext_->bit_rate = bitRate.value_or(0);
9191

9292
validateSampleRate(*avCodec, sampleRate);
9393
avCodecContext_->sample_rate = sampleRate;

src/torchcodec/_core/Encoder.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class AudioEncoder {
2020
// encoding will still work but audio will be distorted.
2121
int sampleRate,
2222
std::string_view fileName,
23-
std::optional<int64_t> bit_rate = std::nullopt);
23+
std::optional<int64_t> bitRate = std::nullopt);
2424
void encode();
2525

2626
private:

0 commit comments

Comments
 (0)