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

Unified Diff: third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp

Issue 2050043002: Generate and assign media track ids in demuxers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@use-streamparser-trackid
Patch Set: Created 4 years, 6 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: third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp
diff --git a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp
index ea97613aa50607a193833f1304a868f28a7b82ad..ad9715aaa5548cb1952076f79fe03f16d848720b 100644
--- a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp
+++ b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp
@@ -590,8 +590,10 @@ WebVector<WebMediaPlayer::TrackId> SourceBuffer::initializationSegmentReceived(c
unsigned resultIdx = 0;
for (const auto& trackInfo : newTracks) {
if (!RuntimeEnabledFeatures::audioVideoTracksEnabled()) {
- static WebMediaPlayer::TrackId nextTrackId = 0;
- result[resultIdx++] = ++nextTrackId;
+ static unsigned nextTrackId = 0;
+ StringBuilder stringBuilder;
+ stringBuilder.appendNumber(++nextTrackId);
+ result[resultIdx++] = stringBuilder.toString();
continue;
}
@@ -630,8 +632,8 @@ WebVector<WebMediaPlayer::TrackId> SourceBuffer::initializationSegmentReceived(c
const char* logActionStr = m_firstInitializationSegmentReceived ? "using existing" : "added";
const char* logTrackTypeStr = (trackInfo.trackType == WebMediaPlayer::AudioTrack) ? "audio" : "video";
DVLOG(SOURCE_BUFFER_LOG_LEVEL) << __FUNCTION__ << "(" << this << ") " << logActionStr << " "
- << logTrackTypeStr << " Track " << trackBase << "trackId=" << trackBase->trackId() << " id="
- << trackBase->id() << " label=" << trackBase->label() << " lang=" << trackBase->language();
+ << logTrackTypeStr << " Track " << trackBase << " trackId=" << (String)trackBase->trackId()
+ << " label=" << trackBase->label() << " lang=" << trackBase->language();
#endif
}

Powered by Google App Engine
This is Rietveld 408576698