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

Side by Side Diff: media/formats/mp4/box_definitions.cc

Issue 166323005: Remove reserved value check in IndependentAndDisposableSamples. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/formats/mp4/box_definitions.h" 5 #include "media/formats/mp4/box_definitions.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "media/formats/mp4/es_descriptor.h" 8 #include "media/formats/mp4/es_descriptor.h"
9 #include "media/formats/mp4/rcheck.h" 9 #include "media/formats/mp4/rcheck.h"
10 10
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 bool IndependentAndDisposableSamples::Parse(BoxReader* reader) { 794 bool IndependentAndDisposableSamples::Parse(BoxReader* reader) {
795 RCHECK(reader->ReadFullBoxHeader()); 795 RCHECK(reader->ReadFullBoxHeader());
796 RCHECK(reader->version() == 0); 796 RCHECK(reader->version() == 0);
797 RCHECK(reader->flags() == 0); 797 RCHECK(reader->flags() == 0);
798 798
799 int sample_count = reader->size() - reader->pos(); 799 int sample_count = reader->size() - reader->pos();
800 sample_depends_on_.resize(sample_count); 800 sample_depends_on_.resize(sample_count);
801 for (int i = 0; i < sample_count; ++i) { 801 for (int i = 0; i < sample_count; ++i) {
802 uint8 sample_info; 802 uint8 sample_info;
803 RCHECK(reader->Read1(&sample_info)); 803 RCHECK(reader->Read1(&sample_info));
804 RCHECK((sample_info >> 6) == 0); // reserved.
805 804
806 sample_depends_on_[i] = 805 sample_depends_on_[i] =
807 static_cast<SampleDependsOn>((sample_info >> 4) & 0x3); 806 static_cast<SampleDependsOn>((sample_info >> 4) & 0x3);
808 807
809 RCHECK(sample_depends_on_[i] != kSampleDependsOnReserved); 808 RCHECK(sample_depends_on_[i] != kSampleDependsOnReserved);
810 } 809 }
811 810
812 return true; 811 return true;
813 } 812 }
814 813
815 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on( 814 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on(
816 size_t i) const { 815 size_t i) const {
817 if (i >= sample_depends_on_.size()) 816 if (i >= sample_depends_on_.size())
818 return kSampleDependsOnUnknown; 817 return kSampleDependsOnUnknown;
819 818
820 return sample_depends_on_[i]; 819 return sample_depends_on_[i];
821 } 820 }
822 821
823 } // namespace mp4 822 } // namespace mp4
824 } // namespace media 823 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698