OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/mp4/box_definitions.h" | 5 #include "media/mp4/box_definitions.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "media/mp4/es_descriptor.h" | 8 #include "media/mp4/es_descriptor.h" |
9 #include "media/mp4/rcheck.h" | 9 #include "media/mp4/rcheck.h" |
10 | 10 |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 RCHECK(reader->ScanChildren()); | 460 RCHECK(reader->ScanChildren()); |
461 if (format == FOURCC_ENCA) { | 461 if (format == FOURCC_ENCA) { |
462 // Continue scanning until a recognized protection scheme is found, or until | 462 // Continue scanning until a recognized protection scheme is found, or until |
463 // we run out of protection schemes. | 463 // we run out of protection schemes. |
464 while (sinf.type.type != FOURCC_CENC) { | 464 while (sinf.type.type != FOURCC_CENC) { |
465 if (!reader->ReadChild(&sinf)) | 465 if (!reader->ReadChild(&sinf)) |
466 return false; | 466 return false; |
467 } | 467 } |
468 } | 468 } |
469 | 469 |
470 RCHECK(reader->ReadChild(&esds)); | 470 // ESDS is not valid in case of EAC3. |
| 471 RCHECK(reader->MaybeReadChild(&esds)); |
471 return true; | 472 return true; |
472 } | 473 } |
473 | 474 |
474 MediaHeader::MediaHeader() | 475 MediaHeader::MediaHeader() |
475 : creation_time(0), | 476 : creation_time(0), |
476 modification_time(0), | 477 modification_time(0), |
477 timescale(0), | 478 timescale(0), |
478 duration(0) {} | 479 duration(0) {} |
479 MediaHeader::~MediaHeader() {} | 480 MediaHeader::~MediaHeader() {} |
480 FourCC MediaHeader::BoxType() const { return FOURCC_MDHD; } | 481 FourCC MediaHeader::BoxType() const { return FOURCC_MDHD; } |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 bool MovieFragment::Parse(BoxReader* reader) { | 748 bool MovieFragment::Parse(BoxReader* reader) { |
748 RCHECK(reader->ScanChildren() && | 749 RCHECK(reader->ScanChildren() && |
749 reader->ReadChild(&header) && | 750 reader->ReadChild(&header) && |
750 reader->ReadChildren(&tracks) && | 751 reader->ReadChildren(&tracks) && |
751 reader->MaybeReadChildren(&pssh)); | 752 reader->MaybeReadChildren(&pssh)); |
752 return true; | 753 return true; |
753 } | 754 } |
754 | 755 |
755 } // namespace mp4 | 756 } // namespace mp4 |
756 } // namespace media | 757 } // namespace media |
OLD | NEW |