diff options
Diffstat (limited to 'libvpx/test/ivf_video_source.h')
-rw-r--r-- | libvpx/test/ivf_video_source.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libvpx/test/ivf_video_source.h b/libvpx/test/ivf_video_source.h index 22c05ecde..a8ac4f154 100644 --- a/libvpx/test/ivf_video_source.h +++ b/libvpx/test/ivf_video_source.h @@ -29,8 +29,9 @@ static unsigned int MemGetLe32(const uint8_t *mem) { class IVFVideoSource : public CompressedVideoSource { public: explicit IVFVideoSource(const std::string &file_name) - : file_name_(file_name), input_file_(NULL), compressed_frame_buf_(NULL), - frame_sz_(0), frame_(0), end_of_file_(false) {} + : file_name_(file_name), input_file_(nullptr), + compressed_frame_buf_(nullptr), frame_sz_(0), frame_(0), + end_of_file_(false) {} virtual ~IVFVideoSource() { delete[] compressed_frame_buf_; @@ -41,13 +42,12 @@ class IVFVideoSource : public CompressedVideoSource { virtual void Init() { // Allocate a buffer for read in the compressed video frame. compressed_frame_buf_ = new uint8_t[libvpx_test::kCodeBufferSize]; - ASSERT_TRUE(compressed_frame_buf_ != NULL) - << "Allocate frame buffer failed"; + ASSERT_NE(compressed_frame_buf_, nullptr) << "Allocate frame buffer failed"; } virtual void Begin() { input_file_ = OpenTestDataFile(file_name_); - ASSERT_TRUE(input_file_ != NULL) + ASSERT_NE(input_file_, nullptr) << "Input file open failed. Filename: " << file_name_; // Read file header @@ -68,7 +68,7 @@ class IVFVideoSource : public CompressedVideoSource { } void FillFrame() { - ASSERT_TRUE(input_file_ != NULL); + ASSERT_NE(input_file_, nullptr); uint8_t frame_hdr[kIvfFrameHdrSize]; // Check frame header and read a frame from input_file. if (fread(frame_hdr, 1, kIvfFrameHdrSize, input_file_) != @@ -87,7 +87,7 @@ class IVFVideoSource : public CompressedVideoSource { } virtual const uint8_t *cxdata() const { - return end_of_file_ ? NULL : compressed_frame_buf_; + return end_of_file_ ? nullptr : compressed_frame_buf_; } virtual size_t frame_size() const { return frame_sz_; } virtual unsigned int frame_number() const { return frame_; } |