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

Unified Diff: media/filters/frame_processor.cc

Issue 2226443002: Support multiple media tracks in MSE / ChunkDemuxer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
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();
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

Powered by Google App Engine
This is Rietveld 408576698