| Index: media/base/mac/videotoolbox_helpers.cc
|
| diff --git a/media/base/mac/videotoolbox_helpers.cc b/media/base/mac/videotoolbox_helpers.cc
|
| index 593a1850eaea64e37944d592699a2d0a9e45cdc8..f3507d9d6eb2711909af996081a184559c633159 100644
|
| --- a/media/base/mac/videotoolbox_helpers.cc
|
| +++ b/media/base/mac/videotoolbox_helpers.cc
|
| @@ -13,6 +13,10 @@ namespace media {
|
|
|
| namespace video_toolbox {
|
|
|
| +namespace {
|
| +static const char kAnnexBHeaderBytes[4] = {0, 0, 0, 1};
|
| +} // anonymous namespace
|
| +
|
| base::ScopedCFTypeRef<CFDictionaryRef>
|
| DictionaryWithKeysAndValues(CFTypeRef* keys, CFTypeRef* values, size_t size) {
|
| return base::ScopedCFTypeRef<CFDictionaryRef>(CFDictionaryCreate(
|
| @@ -113,7 +117,6 @@ void CopyNalsToAnnexB(char* avcc_buffer,
|
| static_assert(sizeof(NalSizeType) == 1 || sizeof(NalSizeType) == 2 ||
|
| sizeof(NalSizeType) == 4,
|
| "NAL size type has unsupported size");
|
| - static const char startcode_3[3] = {0, 0, 1};
|
| DCHECK(avcc_buffer);
|
| DCHECK(annexb_buffer);
|
| size_t bytes_left = avcc_size;
|
| @@ -125,7 +128,7 @@ void CopyNalsToAnnexB(char* avcc_buffer,
|
| avcc_buffer += sizeof(NalSizeType);
|
|
|
| DCHECK_GE(bytes_left, nal_size);
|
| - annexb_buffer->Append(startcode_3, sizeof(startcode_3));
|
| + annexb_buffer->Append(kAnnexBHeaderBytes, sizeof(kAnnexBHeaderBytes));
|
| annexb_buffer->Append(avcc_buffer, nal_size);
|
| bytes_left -= nal_size;
|
| avcc_buffer += nal_size;
|
| @@ -203,8 +206,7 @@ bool CopySampleBufferToAnnexBBuffer(CoreMediaGlue::CMSampleBufferRef sbuf,
|
| << status;
|
| return false;
|
| }
|
| - static const char startcode_4[4] = {0, 0, 0, 1};
|
| - annexb_buffer->Append(startcode_4, sizeof(startcode_4));
|
| + annexb_buffer->Append(kAnnexBHeaderBytes, sizeof(kAnnexBHeaderBytes));
|
| annexb_buffer->Append(reinterpret_cast<const char*>(pset), pset_size);
|
| }
|
| }
|
|
|