summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorRobert Shih <robertshih@google.com>2015-05-05 10:31:48 -0700
committerRobert Shih <robertshih@google.com>2015-05-05 14:23:09 -0700
commita0cf6c4d7d13c73feef5b88760b52b18289b0db2 (patch)
tree74823d0bf82b996cfdc22f9c2748ed77411f316f /cmds
parent464c7e085b68dd63ce8cdbb2c389d3827f8d586a (diff)
downloadframeworks_av-a0cf6c4d7d13c73feef5b88760b52b18289b0db2.zip
frameworks_av-a0cf6c4d7d13c73feef5b88760b52b18289b0db2.tar.gz
frameworks_av-a0cf6c4d7d13c73feef5b88760b52b18289b0db2.tar.bz2
muxer: skip tracks unsupported by MediaMuxer instead of aborting
Bug: 17007397 Change-Id: Id3f3d54a58c76554227e3c103fdbb39422a54496
Diffstat (limited to 'cmds')
-rw-r--r--cmds/stagefright/muxer.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/cmds/stagefright/muxer.cpp b/cmds/stagefright/muxer.cpp
index 0029aec..0d04760 100644
--- a/cmds/stagefright/muxer.cpp
+++ b/cmds/stagefright/muxer.cpp
@@ -142,8 +142,13 @@ static int muxing(
CHECK_EQ(err, (status_t)OK);
ssize_t newTrackIndex = muxer->addTrack(format);
- CHECK_GE(newTrackIndex, 0);
- trackIndexMap.add(i, newTrackIndex);
+ if (newTrackIndex < 0) {
+ fprintf(stderr, "%s track (%d) unsupported by muxer\n",
+ isAudio ? "audio" : "video",
+ i);
+ } else {
+ trackIndexMap.add(i, newTrackIndex);
+ }
}
int64_t muxerStartTimeUs = ALooper::GetNowUs();
@@ -162,7 +167,12 @@ static int muxing(
ALOGV("saw input eos, err %d", err);
sawInputEOS = true;
break;
+ } else if (trackIndexMap.indexOfKey(trackIndex) < 0) {
+ // ALOGV("skipping input from unsupported track %zu", trackIndex);
+ extractor->advance();
+ continue;
} else {
+ // ALOGV("reading sample from track index %zu\n", trackIndex);
err = extractor->readSampleData(newBuffer);
CHECK_EQ(err, (status_t)OK);