From 02b32fc33aca18e6a91a6216ce5d932d348d184c Mon Sep 17 00:00:00 2001 From: James Dong Date: Wed, 26 Oct 2011 23:32:13 -0700 Subject: Report call status from AudioSource::start() to file writer Change-Id: I5109dc87a92170dede4eaa58b039efe6d8b7c330 related-to-bug: 5514288 --- media/libstagefright/codecs/amrnb/enc/AMRNBEncoder.cpp | 6 +++++- media/libstagefright/codecs/amrwbenc/AMRWBEncoder.cpp | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'media') diff --git a/media/libstagefright/codecs/amrnb/enc/AMRNBEncoder.cpp b/media/libstagefright/codecs/amrnb/enc/AMRNBEncoder.cpp index 94a79ab..d361ef4 100644 --- a/media/libstagefright/codecs/amrnb/enc/AMRNBEncoder.cpp +++ b/media/libstagefright/codecs/amrnb/enc/AMRNBEncoder.cpp @@ -82,7 +82,11 @@ status_t AMRNBEncoder::start(MetaData *params) { &mEncState, &mSidState, false /* dtx_enable */), 0); - mSource->start(params); + status_t err = mSource->start(params); + if (err != OK) { + LOGE("AudioSource is not available"); + return err; + } mAnchorTimeUs = 0; mNumFramesOutput = 0; diff --git a/media/libstagefright/codecs/amrwbenc/AMRWBEncoder.cpp b/media/libstagefright/codecs/amrwbenc/AMRWBEncoder.cpp index 002f055..5eacc16 100644 --- a/media/libstagefright/codecs/amrwbenc/AMRWBEncoder.cpp +++ b/media/libstagefright/codecs/amrwbenc/AMRWBEncoder.cpp @@ -137,8 +137,12 @@ status_t AMRWBEncoder::start(MetaData *params) { CHECK_EQ(OK, initCheck()); mNumFramesOutput = 0; - mSource->start(params); + status_t err = mSource->start(params); + if (err != OK) { + LOGE("AudioSource is not available"); + return err; + } mStarted = true; return OK; -- cgit v1.1