summaryrefslogtreecommitdiffstats
path: root/libvideoeditor
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2012-05-30 17:34:24 -0700
committerJames Dong <jdong@google.com>2012-05-30 19:07:45 -0700
commit83410a85993ad6f5f0c122036ff0bda42bf1d4f7 (patch)
tree6dd782ab059a9013ad1b1be957e6a3f19d8fc331 /libvideoeditor
parent3bdb4fbfc6730b6edc0b1ee980141574ed54ed8d (diff)
downloadframeworks_av-83410a85993ad6f5f0c122036ff0bda42bf1d4f7.zip
frameworks_av-83410a85993ad6f5f0c122036ff0bda42bf1d4f7.tar.gz
frameworks_av-83410a85993ad6f5f0c122036ff0bda42bf1d4f7.tar.bz2
Avoid prematurely terminating parsing when some track only has a single access unit
Patch was contributed by teng.hong@nxp.com Change-Id: I0f56361d839f18627e512d18e86f51b58b9b0e05 related-to-bug: 6240789
Diffstat (limited to 'libvideoeditor')
-rwxr-xr-xlibvideoeditor/vss/stagefrightshells/src/VideoEditor3gpReader.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/libvideoeditor/vss/stagefrightshells/src/VideoEditor3gpReader.cpp b/libvideoeditor/vss/stagefrightshells/src/VideoEditor3gpReader.cpp
index c4c4d84..5026073 100755
--- a/libvideoeditor/vss/stagefrightshells/src/VideoEditor3gpReader.cpp
+++ b/libvideoeditor/vss/stagefrightshells/src/VideoEditor3gpReader.cpp
@@ -1867,6 +1867,28 @@ M4OSA_ERR VideoEditor3gpReader_getNextStreamHandler(M4OSA_Context context,
}
err = VideoEditor3gpReader_getNextAu(pC, (*pStreamHandler),
(M4_AccessUnit*)pUserData->m_pFirstAU);
+
+ /*
+ * 1. "M4WAR_NO_MORE_AU == err" indicates that there is no more
+ * access unit from the current track. In other words, there
+ * is only a single access unit from the current track, and
+ * the parsing of this track has reached EOS. The reason why
+ * the first access unit needs to be parsed here is because for
+ * some audio codec (like AAC), the very first access unit
+ * must be decoded before its configuration/encoding parameters
+ * (such as # of channels and sample rate) can be correctly
+ * determined.
+ *
+ * 2. "trackCount > pC->mCurrTrack" indicates that there are other
+ * tracks to be parsed, in addition to the current track.
+ *
+ * When both conditions 1 & 2 hold, other tracks should be
+ * parsed. Thus, we should not bail out.
+ */
+ if (M4WAR_NO_MORE_AU == err && trackCount > pC->mCurrTrack) {
+ err = M4NO_ERROR;
+ }
+
if (M4NO_ERROR != err) {
goto Error;
}