OSDN Git Service

Fix remote submix crash on null sink
authorJean-Michel Trivi <jmtrivi@google.com>
Tue, 14 Oct 2014 22:31:51 +0000 (15:31 -0700)
committerJean-Michel Trivi <jmtrivi@google.com>
Wed, 15 Oct 2014 22:16:10 +0000 (15:16 -0700)
commit793a854e4547fa43632907a987684cadc93eb5e2
treeaea0ead98152f44f9ee4b84c8545cc20784b5cd7
parent1707637ed4b5e68496fe3b2e4264c7a5d502ec6b
Fix remote submix crash on null sink

The "remote submix" HAL uses a MonoPipe instance to "pipe" audio
  from the sink of this virtual device HAL to its source.
  The life-cycle of this pipe is:
  - creation when either the input or output stream is open
  - destruction when both input and output are closed.

Changes are:
Fix test for pipe destruction: destroy pipe when both
  input and output streams are NULL.
Count how many read errors went into the logs and cap them
  so as not to spam the logs when the pipe is not properly
  set up. Less 'I' logs, 'D' logs instead.
When opening input stream, check for non-null sink before
  checking if it's shutdown.

Bug 16653334
Bug 17111907

Change-Id: I634b4192b00f9b74a5109f42242423e9c8cb4c7c
modules/audio_remote_submix/audio_hw.cpp