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

Unified Diff: media/formats/mpeg/mpeg_audio_stream_parser_base.cc

Issue 2239013002: Assign correct track ids to buffers emitted from StreamParsers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « media/formats/mp4/mp4_stream_parser_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/mpeg/mpeg_audio_stream_parser_base.cc
diff --git a/media/formats/mpeg/mpeg_audio_stream_parser_base.cc b/media/formats/mpeg/mpeg_audio_stream_parser_base.cc
index b0bb515b58e1d52e042f112965d9aa138cda8756..944225a653c3d5b68b6a87f835110b23f767a5f7 100644
--- a/media/formats/mpeg/mpeg_audio_stream_parser_base.cc
+++ b/media/formats/mpeg/mpeg_audio_stream_parser_base.cc
@@ -19,6 +19,8 @@
namespace media {
+static const int kMpegAudioTrackId = 1;
+
static const uint32_t kICYStartCode = 0x49435920; // 'ICY '
// Arbitrary upper bound on the size of an IceCast header before it
@@ -222,7 +224,7 @@ int MPEGAudioStreamParserBase::ParseFrame(const uint8_t* data,
std::unique_ptr<MediaTracks> media_tracks(new MediaTracks());
if (config_.IsValidConfig()) {
- media_tracks->AddAudioTrack(config_, 1, "main", "", "");
+ media_tracks->AddAudioTrack(config_, kMpegAudioTrackId, "main", "", "");
}
if (!config_cb_.Run(std::move(media_tracks), TextTrackConfigMap()))
return -1;
@@ -241,9 +243,8 @@ int MPEGAudioStreamParserBase::ParseFrame(const uint8_t* data,
// TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId
// type and allow multiple audio tracks, if applicable. See
// https://crbug.com/341581.
- scoped_refptr<StreamParserBuffer> buffer =
- StreamParserBuffer::CopyFrom(data, frame_size, true,
- DemuxerStream::AUDIO, 0);
+ scoped_refptr<StreamParserBuffer> buffer = StreamParserBuffer::CopyFrom(
+ data, frame_size, true, DemuxerStream::AUDIO, kMpegAudioTrackId);
buffer->set_timestamp(timestamp_helper_->GetTimestamp());
buffer->set_duration(timestamp_helper_->GetFrameDuration(sample_count));
buffers->push_back(buffer);
« no previous file with comments | « media/formats/mp4/mp4_stream_parser_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698