| OLD | NEW |
| 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/mp4_stream_parser.h" | 5 #include "media/formats/mp4/mp4_stream_parser.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 // a codec reconfiguration for fragments using a sample description index | 208 // a codec reconfiguration for fragments using a sample description index |
| 209 // different from the previous one | 209 // different from the previous one |
| 210 size_t desc_idx = 0; | 210 size_t desc_idx = 0; |
| 211 for (size_t t = 0; t < moov_->extends.tracks.size(); t++) { | 211 for (size_t t = 0; t < moov_->extends.tracks.size(); t++) { |
| 212 const TrackExtends& trex = moov_->extends.tracks[t]; | 212 const TrackExtends& trex = moov_->extends.tracks[t]; |
| 213 if (trex.track_id == track->header.track_id) { | 213 if (trex.track_id == track->header.track_id) { |
| 214 desc_idx = trex.default_sample_description_index; | 214 desc_idx = trex.default_sample_description_index; |
| 215 break; | 215 break; |
| 216 } | 216 } |
| 217 } | 217 } |
| 218 LOG(ERROR) << __func__ << " desc_idx:" << desc_idx; |
| 218 RCHECK(desc_idx > 0); | 219 RCHECK(desc_idx > 0); |
| 219 desc_idx -= 1; // BMFF descriptor index is one-based | 220 desc_idx -= 1; // BMFF descriptor index is one-based |
| 220 | 221 |
| 221 if (track->media.handler.type == kAudio) { | 222 if (track->media.handler.type == kAudio) { |
| 222 detected_audio_track_count++; | 223 detected_audio_track_count++; |
| 223 | 224 |
| 224 RCHECK(!samp_descr.audio_entries.empty()); | 225 RCHECK(!samp_descr.audio_entries.empty()); |
| 225 | 226 |
| 226 // It is not uncommon to find otherwise-valid files with incorrect sample | 227 // It is not uncommon to find otherwise-valid files with incorrect sample |
| 227 // description indices, so we fail gracefully in that case. | 228 // description indices, so we fail gracefully in that case. |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 runs.AdvanceSample(); | 732 runs.AdvanceSample(); |
| 732 } | 733 } |
| 733 runs.AdvanceRun(); | 734 runs.AdvanceRun(); |
| 734 } | 735 } |
| 735 | 736 |
| 736 return true; | 737 return true; |
| 737 } | 738 } |
| 738 | 739 |
| 739 } // namespace mp4 | 740 } // namespace mp4 |
| 740 } // namespace media | 741 } // namespace media |
| OLD | NEW |