Index: webrtc/modules/video_coding/utility/ivf_file_writer.cc |
diff --git a/webrtc/modules/video_coding/utility/ivf_file_writer.cc b/webrtc/modules/video_coding/utility/ivf_file_writer.cc |
index 97f1da30e40a1b7fe7b8ad07fd4bd1c684c835b6..a80cf9bf6bc5c11f66f01072795735cce94f7150 100644 |
--- a/webrtc/modules/video_coding/utility/ivf_file_writer.cc |
+++ b/webrtc/modules/video_coding/utility/ivf_file_writer.cc |
@@ -38,7 +38,7 @@ std::unique_ptr<IvfFileWriter> IvfFileWriter::Open(const std::string& file_name, |
VideoCodecType codec_type) { |
std::unique_ptr<IvfFileWriter> file_writer; |
std::unique_ptr<FileWrapper> file(FileWrapper::Create()); |
- if (file->OpenFile(file_name.c_str(), false) != 0) |
+ if (!file->OpenFile(file_name.c_str(), false)) |
return file_writer; |
file_writer.reset(new IvfFileWriter( |
@@ -139,7 +139,7 @@ bool IvfFileWriter::InitFromFirstFrame(const EncodedImage& encoded_image) { |
} |
bool IvfFileWriter::WriteFrame(const EncodedImage& encoded_image) { |
- RTC_DCHECK(file_->Open()); |
+ RTC_DCHECK(file_->is_open()); |
if (num_frames_ == 0 && !InitFromFirstFrame(encoded_image)) |
return false; |
@@ -178,7 +178,7 @@ bool IvfFileWriter::WriteFrame(const EncodedImage& encoded_image) { |
} |
bool IvfFileWriter::Close() { |
- if (!file_->Open()) |
+ if (!file_->is_open()) |
return false; |
if (num_frames_ == 0) { |
@@ -190,7 +190,9 @@ bool IvfFileWriter::Close() { |
return true; |
} |
- return WriteHeader() && (file_->CloseFile() == 0); |
+ bool ret = WriteHeader(); |
+ file_->CloseFile(); |
+ return ret; |
} |
} // namespace webrtc |