Skip to content

Commit

Permalink
update libwebm to libwebm-1.0.0.27-358-gdbf1d10
Browse files Browse the repository at this point in the history
  • Loading branch information
jzern committed Apr 10, 2019
1 parent b2f29a9 commit 34d54b0
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion third_party/libwebm/README.libvpx
@@ -1,5 +1,5 @@
URL: https://chromium.googlesource.com/webm/libwebm
Version: 9f23fbc50e7a76c815b1d3f0309abe1066301331
Version: dbf1d1089756e7cb5b1a04d6752310ef35912347
License: BSD
License File: LICENSE.txt

Expand Down
4 changes: 2 additions & 2 deletions third_party/libwebm/common/file_util.cc
Expand Up @@ -24,8 +24,8 @@ namespace libwebm {
std::string GetTempFileName() {
#if !defined _MSC_VER && !defined __MINGW32__
std::string temp_file_name_template_str =
std::string(std::getenv("TEST_TMPDIR") ? std::getenv("TEST_TMPDIR") :
".") +
std::string(std::getenv("TEST_TMPDIR") ? std::getenv("TEST_TMPDIR")
: ".") +
"/libwebm_temp.XXXXXX";
char* temp_file_name_template =
new char[temp_file_name_template_str.length() + 1];
Expand Down
8 changes: 4 additions & 4 deletions third_party/libwebm/mkvmuxer/mkvmuxerutil.cc
Expand Up @@ -562,10 +562,10 @@ uint64 WriteFrame(IMkvWriter* writer, const Frame* const frame,
if (relative_timecode < 0 || relative_timecode > kMaxBlockTimecode)
return 0;

return frame->CanBeSimpleBlock() ?
WriteSimpleBlock(writer, frame, relative_timecode) :
WriteBlock(writer, frame, relative_timecode,
cluster->timecode_scale());
return frame->CanBeSimpleBlock()
? WriteSimpleBlock(writer, frame, relative_timecode)
: WriteBlock(writer, frame, relative_timecode,
cluster->timecode_scale());
}

uint64 WriteVoidElement(IMkvWriter* writer, uint64 size) {
Expand Down
3 changes: 3 additions & 0 deletions third_party/libwebm/mkvmuxer/mkvmuxerutil.h
Expand Up @@ -31,6 +31,9 @@ const int64 kMaxBlockTimecode = 0x07FFFLL;
// Writes out |value| in Big Endian order. Returns 0 on success.
int32 SerializeInt(IMkvWriter* writer, int64 value, int32 size);

// Writes out |f| in Big Endian order. Returns 0 on success.
int32 SerializeFloat(IMkvWriter* writer, float f);

// Returns the size in bytes of the element.
int32 GetUIntSize(uint64 value);
int32 GetIntSize(int64 value);
Expand Down
10 changes: 7 additions & 3 deletions third_party/libwebm/mkvparser/mkvparser.cc
Expand Up @@ -5311,7 +5311,7 @@ long VideoTrack::Parse(Segment* pSegment, const Info& info,

const long long stop = pos + s.size;

Colour* colour = NULL;
std::unique_ptr<Colour> colour_ptr;
std::unique_ptr<Projection> projection_ptr;

while (pos < stop) {
Expand Down Expand Up @@ -5361,8 +5361,12 @@ long VideoTrack::Parse(Segment* pSegment, const Info& info,
if (rate <= 0)
return E_FILE_FORMAT_INVALID;
} else if (id == libwebm::kMkvColour) {
if (!Colour::Parse(pReader, pos, size, &colour))
Colour* colour = NULL;
if (!Colour::Parse(pReader, pos, size, &colour)) {
return E_FILE_FORMAT_INVALID;
} else {
colour_ptr.reset(colour);
}
} else if (id == libwebm::kMkvProjection) {
Projection* projection = NULL;
if (!Projection::Parse(pReader, pos, size, &projection)) {
Expand Down Expand Up @@ -5404,7 +5408,7 @@ long VideoTrack::Parse(Segment* pSegment, const Info& info,
pTrack->m_display_unit = display_unit;
pTrack->m_stereo_mode = stereo_mode;
pTrack->m_rate = rate;
pTrack->m_colour = colour;
pTrack->m_colour = colour_ptr.release();
pTrack->m_colour_space = colour_space;
pTrack->m_projection = projection_ptr.release();

Expand Down

0 comments on commit 34d54b0

Please sign in to comment.