Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: source/libvpx/test/y4m_video_source.h

Issue 181493009: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/libvpx/test/webm_video_source.h ('k') | source/libvpx/tools_common.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/test/y4m_video_source.h
===================================================================
--- source/libvpx/test/y4m_video_source.h (revision 254565)
+++ source/libvpx/test/y4m_video_source.h (working copy)
@@ -35,14 +35,11 @@
virtual ~Y4mVideoSource() {
vpx_img_free(img_.get());
- y4m_input_close(&y4m_);
- if (input_file_)
- fclose(input_file_);
+ CloseSource();
}
virtual void Begin() {
- if (input_file_)
- fclose(input_file_);
+ CloseSource();
input_file_ = OpenTestDataFile(file_name_);
ASSERT_TRUE(input_file_ != NULL) << "Input file open failed. Filename: "
<< file_name_;
@@ -89,6 +86,15 @@
}
protected:
+ void CloseSource() {
+ y4m_input_close(&y4m_);
+ y4m_ = y4m_input();
+ if (input_file_ != NULL) {
+ fclose(input_file_);
+ input_file_ = NULL;
+ }
+ }
+
std::string file_name_;
FILE *input_file_;
testing::internal::scoped_ptr<vpx_image_t> img_;
« no previous file with comments | « source/libvpx/test/webm_video_source.h ('k') | source/libvpx/tools_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698