diff options
author | James Dong <jdong@google.com> | 2010-05-20 17:55:52 -0700 |
---|---|---|
committer | James Dong <jdong@google.com> | 2010-05-20 18:02:52 -0700 |
commit | e136c3bb38e88315bf8797a464ebf2c788296b22 (patch) | |
tree | c978a5038df7663487fa0ae3bbaadb8517d38f99 /media/libstagefright/MPEG4Writer.cpp | |
parent | 64105f956f15969dbe1ec7319f6caa2a984e588b (diff) | |
download | frameworks_av-e136c3bb38e88315bf8797a464ebf2c788296b22.zip frameworks_av-e136c3bb38e88315bf8797a464ebf2c788296b22.tar.gz frameworks_av-e136c3bb38e88315bf8797a464ebf2c788296b22.tar.bz2 |
Properly handle start code in H264/AVC encoder output
- Some H264/AVC encoder output start code in each output buffer, and others don't.
This patch always strips the start code first so that the sample contains the correct size.
- Also properly initialize the interleave duration.
Change-Id: I692043ce7e38f0215e1097aad9e847a57907b6e4
Diffstat (limited to 'media/libstagefright/MPEG4Writer.cpp')
-rw-r--r-- | 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 094059d..e0f8f9e 100644 --- a/media/libstagefright/MPEG4Writer.cpp +++ b/media/libstagefright/MPEG4Writer.cpp @@ -334,8 +334,6 @@ static void StripStartcode(MediaBuffer *buffer) { } off_t MPEG4Writer::addLengthPrefixedSample_l(MediaBuffer *buffer) { - StripStartcode(buffer); - off_t old_offset = mOffset; size_t length = buffer->range_length(); @@ -827,6 +825,8 @@ void MPEG4Writer::Track::threadEntry() { continue; } + if (is_avc) StripStartcode(buffer); + SampleInfo info; info.size = is_avc #if USE_NALLEN_FOUR |