Fix tee sink

Note: this does not fix the bug below, but it helps to investigate the bug.

Bug: 17578238
Change-Id: I0fd27a477b73ba0e1c5a658bdfad17c500f5dc67
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index 818bb05..d885558 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -2803,6 +2803,7 @@
 
         // create a MonoPipe to connect our submix to FastMixer
         NBAIO_Format format = mOutputSink->format();
+        NBAIO_Format origformat = format;
         // adjust format to match that of the Fast Mixer
         format.mFormat = fastMixerFormat;
         format.mFrameSize = audio_bytes_per_sample(format.mFormat) * format.mChannelCount;
@@ -2822,14 +2823,15 @@
 #ifdef TEE_SINK
         if (mTeeSinkOutputEnabled) {
             // create a Pipe to archive a copy of FastMixer's output for dumpsys
-            Pipe *teeSink = new Pipe(mTeeSinkOutputFrames, format);
+            Pipe *teeSink = new Pipe(mTeeSinkOutputFrames, origformat);
+            const NBAIO_Format offers2[1] = {origformat};
             numCounterOffers = 0;
-            index = teeSink->negotiate(offers, 1, NULL, numCounterOffers);
+            index = teeSink->negotiate(offers2, 1, NULL, numCounterOffers);
             ALOG_ASSERT(index == 0);
             mTeeSink = teeSink;
             PipeReader *teeSource = new PipeReader(*teeSink);
             numCounterOffers = 0;
-            index = teeSource->negotiate(offers, 1, NULL, numCounterOffers);
+            index = teeSource->negotiate(offers2, 1, NULL, numCounterOffers);
             ALOG_ASSERT(index == 0);
             mTeeSource = teeSource;
         }