Fix race b/w  prepareInitialInputBuffers and feedInputBuffersIfAvailable

 After flush, input buffers can be either with codec or
 framework. Bufferchannel was started before prepareInitialInputBuffers,
 which caused input buffer returning through onWorkDone sent to
 client. The was causing a failure during prepare buffers stage.
 With this change, the buferchannel is only started after the
 the preparation is complete.

 For the buffers not yet released by the codec after flush and before
 signalResume, the failure in prepareInitialInputBuffers will be
 recovered immediatly as the bufers are released. So this failure
 is logged and the codec is allowed to contine without errors.

Bug: 245397641

Test: manual per b/237656746#comment19
Test: atest android.media.decoder.cts.AdaptivePlaybackTest
Test: atest android.media.cts.MediaCodecTest


Change-Id: I8051d0b2d74f251964b733a7b7948a9d626c011e
1 file changed