Index: media/filters/frame_processor.cc |
diff --git a/media/filters/frame_processor.cc b/media/filters/frame_processor.cc |
index 13dba12964dc789fb745a9d5db72dabfab8e9476..c6b1bc04d063854ba80fdd2c064dd819b1002cee 100644 |
--- a/media/filters/frame_processor.cc |
+++ b/media/filters/frame_processor.cc |
@@ -565,24 +565,7 @@ bool FrameProcessor::ProcessFrame( |
// 5. Let track buffer equal the track buffer that the coded frame will be |
// added to. |
- |
- // Remap audio and video track types to their special singleton identifiers. |
- StreamParser::TrackId track_id = kAudioTrackId; |
- switch (frame->type()) { |
- case DemuxerStream::AUDIO: |
- break; |
- case DemuxerStream::VIDEO: |
- track_id = kVideoTrackId; |
- break; |
- case DemuxerStream::TEXT: |
- track_id = frame->track_id(); |
- break; |
- case DemuxerStream::UNKNOWN: |
- case DemuxerStream::NUM_TYPES: |
- DCHECK(false) << ": Invalid frame type " << frame->type(); |
- return false; |
- } |
- |
+ StreamParser::TrackId track_id = frame->track_id(); |
wolenetz
2016/09/13 21:03:13
aside: WOOT! :)
servolk
2016/09/14 18:15:25
Acknowledged.
|
MseTrackBuffer* track_buffer = FindTrack(track_id); |
if (!track_buffer) { |
MEDIA_LOG(ERROR, media_log_) |
@@ -591,6 +574,12 @@ bool FrameProcessor::ProcessFrame( |
<< ", and parser track id " << frame->track_id(); |
return false; |
} |
+ if (frame->type() != track_buffer->stream()->type()) { |
+ MEDIA_LOG(ERROR, media_log_) << "Frame type " << frame->GetTypeName() |
+ << " doesn't match track buffer type " |
+ << track_buffer->stream()->type(); |
+ return false; |
+ } |
// 6. If last decode timestamp for track buffer is set and decode timestamp |
// is less than last decode timestamp |