diff options
author | hkuang <hkuang@google.com> | 2014-04-10 17:21:41 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-04-10 17:21:41 +0000 |
commit | 704338728f68ac5ff7f36186bc4cdff890994959 (patch) | |
tree | d4655502ab2768db0858ae72ba2de7b530fa3afd /libvpx/third_party/libwebm | |
parent | 7616a7e29066d65ecd1d6f54485360d3964c67bb (diff) | |
parent | 4fb68e5dd4e93c7599dc905d861de11ac39c5585 (diff) | |
download | android_external_libvpx-704338728f68ac5ff7f36186bc4cdff890994959.tar.gz android_external_libvpx-704338728f68ac5ff7f36186bc4cdff890994959.tar.bz2 android_external_libvpx-704338728f68ac5ff7f36186bc4cdff890994959.zip |
am 4fb68e5d: Roll latest libvpx to fix hang when doing adaptive playback.
* commit '4fb68e5dd4e93c7599dc905d861de11ac39c5585':
Roll latest libvpx to fix hang when doing adaptive playback.
Diffstat (limited to 'libvpx/third_party/libwebm')
-rw-r--r-- | libvpx/third_party/libwebm/README.webm | 2 | ||||
-rw-r--r-- | libvpx/third_party/libwebm/mkvmuxerutil.cpp | 4 | ||||
-rw-r--r-- | libvpx/third_party/libwebm/mkvreader.cpp | 29 | ||||
-rw-r--r-- | libvpx/third_party/libwebm/mkvreader.hpp | 8 |
4 files changed, 33 insertions, 10 deletions
diff --git a/libvpx/third_party/libwebm/README.webm b/libvpx/third_party/libwebm/README.webm index b13c8cb..2c7570d 100644 --- a/libvpx/third_party/libwebm/README.webm +++ b/libvpx/third_party/libwebm/README.webm @@ -1,5 +1,5 @@ URL: https://chromium.googlesource.com/webm/libwebm -Version: 630a0e3c338e1b32bddf513a2dad807908d2976a +Version: a7118d8ec564e9db841da1eb01f547f3229f240a License: BSD License File: LICENSE.txt diff --git a/libvpx/third_party/libwebm/mkvmuxerutil.cpp b/libvpx/third_party/libwebm/mkvmuxerutil.cpp index 96350e9..18060e9 100644 --- a/libvpx/third_party/libwebm/mkvmuxerutil.cpp +++ b/libvpx/third_party/libwebm/mkvmuxerutil.cpp @@ -292,11 +292,11 @@ bool WriteEbmlElement(IMkvWriter* writer, uint64 type, const char* value) { if (WriteID(writer, type)) return false; - const int32 length = strlen(value); + const uint64 length = strlen(value); if (WriteUInt(writer, length)) return false; - if (writer->Write(value, length)) + if (writer->Write(value, static_cast<const uint32>(length))) return false; return true; diff --git a/libvpx/third_party/libwebm/mkvreader.cpp b/libvpx/third_party/libwebm/mkvreader.cpp index cb3567f..b4b2459 100644 --- a/libvpx/third_party/libwebm/mkvreader.cpp +++ b/libvpx/third_party/libwebm/mkvreader.cpp @@ -14,13 +14,20 @@ namespace mkvparser { MkvReader::MkvReader() : - m_file(NULL) -{ + m_file(NULL), + reader_owns_file_(true) { } -MkvReader::~MkvReader() -{ +MkvReader::MkvReader(FILE* fp) : + m_file(fp), + reader_owns_file_(false) { + GetFileSize(); +} + +MkvReader::~MkvReader() { + if (reader_owns_file_) Close(); + m_file = NULL; } int MkvReader::Open(const char* fileName) @@ -42,12 +49,17 @@ int MkvReader::Open(const char* fileName) if (m_file == NULL) return -1; #endif + return !GetFileSize(); +} +bool MkvReader::GetFileSize() { + if (m_file == NULL) + return false; #ifdef _MSC_VER int status = _fseeki64(m_file, 0L, SEEK_END); if (status) - return -1; //error + return false; //error m_length = _ftelli64(m_file); #else @@ -56,16 +68,19 @@ int MkvReader::Open(const char* fileName) #endif assert(m_length >= 0); + if (m_length < 0) + return false; + #ifdef _MSC_VER status = _fseeki64(m_file, 0L, SEEK_SET); if (status) - return -1; //error + return false; //error #else fseek(m_file, 0L, SEEK_SET); #endif - return 0; + return true; } void MkvReader::Close() diff --git a/libvpx/third_party/libwebm/mkvreader.hpp b/libvpx/third_party/libwebm/mkvreader.hpp index adcc29f..8ebdd99 100644 --- a/libvpx/third_party/libwebm/mkvreader.hpp +++ b/libvpx/third_party/libwebm/mkvreader.hpp @@ -21,6 +21,7 @@ class MkvReader : public IMkvReader MkvReader& operator=(const MkvReader&); public: MkvReader(); + MkvReader(FILE* fp); virtual ~MkvReader(); int Open(const char*); @@ -29,8 +30,15 @@ public: virtual int Read(long long position, long length, unsigned char* buffer); virtual int Length(long long* total, long long* available); private: + + // Determines the size of the file. This is called either by the constructor + // or by the Open function depending on file ownership. Returns true on + // success. + bool GetFileSize(); + long long m_length; FILE* m_file; + bool reader_owns_file_; }; } //end namespace mkvparser |