092bae63f1
EOS was being treated as a flush operation which was causing problems. In particular, the transmitter was delcaring that playback was complete early (by the clock lead time of the system, which was 1 second in this case). Also, the receiver was treating the EOS message just like the flush message, immediately destroying the substreams associated with the program without letting them play out first. Change the transmitter to send the EOS message like it always does, but have it wait until the media time of the last sample has arrived before reporting playback complete to the app level of things. On the receiver side of things, don't treat the EOS message like the flush message. Instead, have the EOS message simply put the substream into EOS mode, allowing it to signal EOS to its decoder and shut off the isAboutToUnderflow hack. Change-Id: Ibe3ac01044373f83edb7a5f4b70478bd78c16d11