diff options
author | James Dong <jdong@google.com> | 2012-08-07 16:54:22 -0700 |
---|---|---|
committer | James Dong <jdong@google.com> | 2012-08-07 16:57:49 -0700 |
commit | 219f195159f93d627af2b243732e3f9020511a46 (patch) | |
tree | 3f8c072142c982726d9e56c4858c5493c8d128ba /media/libstagefright/MPEG4Writer.cpp | |
parent | a9e0ea58738a50de84a80d3b4db1936e7433dce4 (diff) | |
download | frameworks_av-219f195159f93d627af2b243732e3f9020511a46.zip frameworks_av-219f195159f93d627af2b243732e3f9020511a46.tar.gz frameworks_av-219f195159f93d627af2b243732e3f9020511a46.tar.bz2 |
Make sure that the trackId starts from 1
o this patch avoids sending incorrect track events to applications because
track events contain the trackId
Change-Id: I1cf054da8ab413d31a5b7fe8ed729486d1475c46
Diffstat (limited to 'media/libstagefright/MPEG4Writer.cpp')
-rwxr-xr-x | media/libstagefright/MPEG4Writer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp index 5aad99f..86477ba 100755 --- a/media/libstagefright/MPEG4Writer.cpp +++ b/media/libstagefright/MPEG4Writer.cpp @@ -428,7 +428,7 @@ status_t MPEG4Writer::addSource(const sp<MediaSource> &source) { ALOGE("Attempt to add source AFTER recording is started"); return UNKNOWN_ERROR; } - Track *track = new Track(this, source, mTracks.size()); + Track *track = new Track(this, source, 1 + mTracks.size()); mTracks.push_back(track); return OK; @@ -2693,7 +2693,7 @@ void MPEG4Writer::Track::writeTkhdBox(time_t now) { mOwner->writeInt32(0x07); // version=0, flags=7 mOwner->writeInt32(now); // creation time mOwner->writeInt32(now); // modification time - mOwner->writeInt32(mTrackId + 1); // track id starts with 1 + mOwner->writeInt32(mTrackId); // track id starts with 1 mOwner->writeInt32(0); // reserved int64_t trakDurationUs = getDurationUs(); int32_t mvhdTimeScale = mOwner->getTimeScale(); |