Skip to content

Commit 01dc1b1

Browse files
committed
NULL -> nullptr
1 parent 75b099b commit 01dc1b1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/torchcodec/_core/Encoder.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Encoder::~Encoder() {}
1313
Encoder::Encoder(int sampleRate, std::string_view fileName)
1414
: sampleRate_(sampleRate) {
1515
AVFormatContext* avFormatContext = nullptr;
16-
avformat_alloc_output_context2(&avFormatContext, NULL, NULL, fileName.data());
16+
avformat_alloc_output_context2(&avFormatContext, nullptr, nullptr, fileName.data());
1717
TORCH_CHECK(avFormatContext != nullptr, "Couldn't allocate AVFormatContext.");
1818
avFormatContext_.reset(avFormatContext);
1919

@@ -71,7 +71,7 @@ Encoder::Encoder(int sampleRate, std::string_view fileName)
7171
// We're allocating the stream here. Streams are meant to be freed by
7272
// avformat_free_context(avFormatContext), which we call in the
7373
// avFormatContext_'s destructor.
74-
avStream_ = avformat_new_stream(avFormatContext_.get(), NULL);
74+
avStream_ = avformat_new_stream(avFormatContext_.get(), nullptr);
7575
TORCH_CHECK(avStream_ != nullptr, "Couldn't create new stream.");
7676
avcodec_parameters_from_context(avStream_->codecpar, avCodecContext_.get());
7777
}
@@ -117,7 +117,7 @@ void Encoder::encode(const torch::Tensor& wf) {
117117
AV_NUM_DATA_POINTERS,
118118
" channels per frame.");
119119

120-
ffmpegRet = avformat_write_header(avFormatContext_.get(), NULL);
120+
ffmpegRet = avformat_write_header(avFormatContext_.get(), nullptr);
121121
TORCH_CHECK(
122122
ffmpegRet == AVSUCCESS,
123123
"Error in avformat_write_header: ",

0 commit comments

Comments
 (0)