Skip to content

Commit 02b32fc

Browse files
author
James Dong
committed
Report call status from AudioSource::start() to file writer
Change-Id: I5109dc87a92170dede4eaa58b039efe6d8b7c330 related-to-bug: 5514288
1 parent 27812a8 commit 02b32fc

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

media/libstagefright/codecs/amrnb/enc/AMRNBEncoder.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ status_t AMRNBEncoder::start(MetaData *params) {
8282
&mEncState, &mSidState, false /* dtx_enable */),
8383
0);
8484

85-
mSource->start(params);
85+
status_t err = mSource->start(params);
86+
if (err != OK) {
87+
LOGE("AudioSource is not available");
88+
return err;
89+
}
8690

8791
mAnchorTimeUs = 0;
8892
mNumFramesOutput = 0;

media/libstagefright/codecs/amrwbenc/AMRWBEncoder.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,12 @@ status_t AMRWBEncoder::start(MetaData *params) {
137137
CHECK_EQ(OK, initCheck());
138138

139139
mNumFramesOutput = 0;
140-
mSource->start(params);
141140

141+
status_t err = mSource->start(params);
142+
if (err != OK) {
143+
LOGE("AudioSource is not available");
144+
return err;
145+
}
142146
mStarted = true;
143147

144148
return OK;

0 commit comments

Comments
 (0)