diff options
Diffstat (limited to 'media/libmediaplayerservice/StagefrightRecorder.cpp')
-rw-r--r-- | media/libmediaplayerservice/StagefrightRecorder.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/media/libmediaplayerservice/StagefrightRecorder.cpp b/media/libmediaplayerservice/StagefrightRecorder.cpp index 817ae4d..49804c5 100644 --- a/media/libmediaplayerservice/StagefrightRecorder.cpp +++ b/media/libmediaplayerservice/StagefrightRecorder.cpp @@ -991,6 +991,13 @@ sp<MediaSource> StagefrightRecorder::createAudioSource() { sp<MediaSource> audioEncoder = MediaCodecSource::Create(mLooper, format, audioSource); + // If encoder could not be created (as in LPCM), then + // use the AudioSource directly as the MediaSource. + if (audioEncoder == NULL && + mAudioEncoder == AUDIO_ENCODER_LPCM) { + ALOGD("No encoder is needed for linear PCM format"); + audioEncoder = audioSource; + } mAudioSourceNode = audioSource; if (audioEncoder == NULL) { |