diff options
Diffstat (limited to 'media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp')
-rw-r--r-- | media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp index 97d2942..d9e3ee8 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp @@ -38,7 +38,7 @@ namespace android { // Maximum time in paused state when offloading audio decompression. When elapsed, the AudioSink // is closed to allow the audio DSP to power down. -static const int64_t kOffloadPauseMaxUs = 60000000ll; +static const int64_t kOffloadPauseMaxUs = 10000000ll; // static const int64_t NuPlayer::Renderer::kMinPositionUpdateDelayUs = 100000ll; @@ -1378,8 +1378,9 @@ bool NuPlayer::Renderer::onOpenAudioSink( return offloadingAudio(); } ALOGV("openAudioSink: try to open AudioSink in offload mode"); - flags |= AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD; - flags &= ~AUDIO_OUTPUT_FLAG_DEEP_BUFFER; + uint32_t offloadFlags = flags; + offloadFlags |= AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD; + offloadFlags &= ~AUDIO_OUTPUT_FLAG_DEEP_BUFFER; audioSinkChanged = true; mAudioSink->close(); err = mAudioSink->open( @@ -1390,7 +1391,7 @@ bool NuPlayer::Renderer::onOpenAudioSink( 8 /* bufferCount */, &NuPlayer::Renderer::AudioSinkCallback, this, - (audio_output_flags_t)flags, + (audio_output_flags_t)offloadFlags, &offloadInfo); if (err == OK) { @@ -1414,9 +1415,9 @@ bool NuPlayer::Renderer::onOpenAudioSink( } } if (!offloadOnly && !offloadingAudio()) { - flags &= ~AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD; ALOGV("openAudioSink: open AudioSink in NON-offload mode"); - + uint32_t pcmFlags = flags; + pcmFlags &= ~AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD; audioSinkChanged = true; mAudioSink->close(); mCurrentOffloadInfo = AUDIO_INFO_INITIALIZER; @@ -1428,7 +1429,7 @@ bool NuPlayer::Renderer::onOpenAudioSink( 8 /* bufferCount */, NULL, NULL, - (audio_output_flags_t)flags), + (audio_output_flags_t)pcmFlags), (status_t)OK); mAudioSink->start(); } |